Skip to content

Commit

Permalink
Merge pull request #62 from splunk/release/0.11.0
Browse files Browse the repository at this point in the history
Release 0.11.0
  • Loading branch information
ashah-splunk committed Jul 28, 2021
2 parents 0eba3cb + 769469f commit 28f1f51
Show file tree
Hide file tree
Showing 16 changed files with 281 additions and 170 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Create Release
on:
release:
types: [published]
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
with:
node-version: '14.0'
registry-url: 'https://registry.npmjs.org'
- run: npm install
# Publish to npm
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
[push, pull_request]

jobs:
test-execution:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "14.0"
- "10.0"
splunk-version:
- latest
- "8.0"
services:
splunk:
image: splunk/splunk:${{matrix.splunk-version}}
env:
SPLUNK_START_ARGS: --accept-license
SPLUNK_PASSWORD: changed!
ports:
- 8088:8088
- 8089:8089
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Test Execution
run: npm test
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"es5" : false, // Allow EcmaScript 5 syntax.
"strict" : false, // Require `use strict` pragma in every file.
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
"esversion" : 6,


// The Good Parts.
Expand Down
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Splunk logging for JavaScript

## v0.11.0

### New features & APIs

* Replaced client implementation to use `needle` in lieu of deprecated `request`
* Replaced client implementation to use `nyc` in lieu of deprecated `istanbul`

### Minor changes

* Converted CI from Travis to Github Actions and added CD
* Upgrade version of jsdoc to 3.6.7.
* Upgrade version of jshint to 2.12.0.
* Upgrade version of mocha to 8.4.0.

## v0.10.1

### Minor changes
Expand Down
7 changes: 7 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Third-party software credits

Some of the components included in the Splunk logging for JavaScript are licensed under free or open source licenses. We wish to thank the contributors to those projects.

| Contributor | Description | License |
|:----------- |:----------- |:------- |
| [needle](https://github.com/tomas/needle) | Node.js http client | [MIT](https://github.com/splunk/splunk-javascript-logging/blob/master/licenses/LICENSE-NEEDLE) |
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# text reset
NO_COLOR=\033[0m
# green
OK_COLOR=\033[32;01m
# red
ERROR_COLOR=\033[31;01m
# cyan
WARN_COLOR=\033[36;01m
# yellow
ATTN_COLOR=\033[33;01m

ROOT_DIR := $(shell git rev-parse --show-toplevel)

VERSION := `git describe --tags --dirty 2>/dev/null`
COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
DATE := `date "+%FT%T%z"`

.PHONY: all
all: init test

init:
@echo "$(ATTN_COLOR)==> init $(NO_COLOR)"

.PHONY: test
test:
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
@npm test

.PHONY: test_specific
test_specific:
@echo "$(ATTN_COLOR)==> test_specific $(NO_COLOR)"
@sh ./scripts/test_specific.sh

.PHONY: up
up:
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
@docker-compose up -d

.PHONY: wait_up
wait_up:
@echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
@for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done

.PHONY: down
down:
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
@docker-compose stop
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Splunk logging for JavaScript

#### Version 0.10.1
#### Version 0.11.0

This project provides a simple JavaScript interface for logging to HTTP Event Collector in Splunk Enterprise and Splunk Cloud.

## Requirements

* Node.js v4 or later.
* Splunk Enterprise 6.3.0 or later, or Splunk Cloud.
* Node.js v4 or later. Splunk logging for Javascript is tested with Node.js v10.0 and v14.0.
* Splunk Enterprise 6.3.0 or later, or Splunk Cloud. Splunk logging for Javascript is tested with Splunk Enterprise 8.0 and 8.2.0.
* An HTTP Event Collector token from your Splunk Enterprise server.

## Installation
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
splunk:
image: "splunk/splunk:latest"
container_name: splunk
environment:
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_PASSWORD=changed!
ports:
- 8000:8000
- 8088:8088
- 8089:8089
healthcheck:
test: ['CMD', 'curl', '-f', 'https://localhost:8000']
interval: 5s
timeout: 5s
retries: 20
19 changes: 19 additions & 0 deletions licenses/LICENSE-NEEDLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) Fork, Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
35 changes: 16 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "splunk-logging",
"version": "0.10.1",
"version": "0.11.0",
"description": "Splunk HTTP Event Collector logging interface",
"homepage": "http://dev.splunk.com",
"main": "index.js",
"scripts": {
"docs": "jsdoc -d docs .",
"jshint": "jshint *.js test examples",
"pretest": "npm run jshint && npm run docs",
"test": "istanbul cover _mocha -- -R spec --exit"
"test": "nyc --reporter=lcov --reporter=text-summary _mocha -- -R spec --exit",
"test-specific-file": "_mocha -- -R spec --exit ",
"test-specific": "_mocha -- -R spec --exit -g "
},
"repository": {
"type": "git",
Expand All @@ -32,12 +34,12 @@
"node": ">=4.0.0"
},
"dependencies": {
"request": "^2.88.0"
"needle": "^2.6.0"
},
"devDependencies": {
"istanbul": "^0.4.5",
"jsdoc": "^3.5.5",
"jshint": "^2.9.6",
"mocha": "^5.2.0"
"nyc": "^15.1.0",
"jsdoc": "^3.6.7",
"jshint": "^2.12.0",
"mocha": "^8.4.0"
}
}
4 changes: 4 additions & 0 deletions scripts/test_specific.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "To run a specific test file:"
echo " npm run test-specific-file [test/<test-file1> test/<test-file2> ..]"
echo "To run a specific test case:"
echo " npm run test-specific '<test-description>'"
Loading

0 comments on commit 28f1f51

Please sign in to comment.