diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0449e4a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + allow: + - dependency-type: production diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml deleted file mode 100644 index 69d8c89..0000000 --- a/.github/workflows/ci-test.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Unit Tests - -on: [ push ] - -jobs: - - ci-test: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ ubuntu-latest ] - node-version: [10.x, 12.x, 14.x] - fail-fast: false - - steps: - - - name: Configure sysctl limits - run: | - sudo swapoff -a - sudo sysctl -w vm.swappiness=1 - sudo sysctl -w fs.file-max=262144 - sudo sysctl -w vm.max_map_count=262144 - - - uses: miyataka/elasticsearch-github-actions@1 - with: - stack-version: '6.8.8' - - - uses: actions/checkout@v1 - name: Checkout project - with: - fetch-depth: 1 - - - uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }} - with: - node-version: ${{ matrix.node-version }} - - - name: npm install - run: npm install - - - name: Run test suite - run: npm run test - - env: - CI: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..674f3b3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: [ push ] + +env: + CI: true + +jobs: + + lint: + uses: haraka/.github/.github/workflows/lint.yml@master + + # coverage: + # uses: haraka/.github/.github/workflows/coverage.yml@master + # secrets: inherit + + test: + needs: [ lint, get-lts ] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + node-version: ${{ fromJson(needs.get-lts.outputs.active) }} + fail-fast: false + steps: + - name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + - uses: miyataka/elasticsearch-github-actions@1 + with: + stack-version: '7.6.2' + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + name: Node ${{ matrix.node-version }} on ${{ matrix.os }} + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + + get-lts: + runs-on: ubuntu-latest + steps: + - id: get + uses: msimerson/node-lts-versions@v1 + outputs: + active: ${{ steps.get.outputs.active }} + lts: ${{ steps.get.outputs.lts }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..383aca2 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,13 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: '18 7 * * 4' + +jobs: + codeql: + uses: haraka/.github/.github/workflows/codeql.yml@master diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 9f799ef..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Lint - -on: [ push ] - -jobs: - - lint: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [ 12.x ] - - steps: - - uses: actions/checkout@v1 - name: Checkout - with: - fetch-depth: 1 - - - uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }} - with: - node-version: ${{ matrix.node-version }} - - - name: npm install - run: npm install - - - name: Lint using eslint - run: npm run lint - - env: - CI: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..42a9bb9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,14 @@ +name: publish + +on: + push: + branches: + - master + +env: + CI: true + +jobs: + publish: + uses: haraka/.github/.github/workflows/publish.yml@master + secrets: inherit \ No newline at end of file diff --git a/.gitignore b/.gitignore index f271986..ed0d256 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,5 @@ typings/ .env package-lock.json + +haraka-update.sh diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8e94cb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".release"] + path = .release + url = git@github.com:msimerson/.release.git diff --git a/.release b/.release new file mode 160000 index 0000000..9be2b27 --- /dev/null +++ b/.release @@ -0,0 +1 @@ +Subproject commit 9be2b270ef836bcfefda085674bf62e2a91defe8 diff --git a/Changes.md b/Changes.md index d8387bc..0dfb016 100644 --- a/Changes.md +++ b/Changes.md @@ -1,12 +1,21 @@ +### Unreleased -## 1.0.6 - 2020-07-21 + +### [1.0.7] - 2022-06-06 + +- ci: use shared GHA workflows +- ci: add submodule .release +- es7: update index map template + + +### 1.0.6 - 2020-07-21 - add URI for connection settings - add options to specify user & ssl connection settings - bump elasticsearch client to version 7.8 -## 1.0.5 - 2020-04-29 +### 1.0.5 - 2020-04-29 - update to upstream @elastic/elasticsearch@6 - convert test runner to mocha @@ -14,29 +23,31 @@ - package.json: depend on latest eslint -## 1.0.4 - 2019-09-22 +### 1.0.4 - 2019-09-22 - update index template for ES 6 -## 1.0.3 - 2017-08-22 +### 1.0.3 - 2017-08-22 - fix txr variable scope - add tests for get_es_hosts -## 1.0.2 - 2017-07-29 +### 1.0.2 - 2017-07-29 - also prune null values because typeof null === object - add test storing doc against index template - get ES testing working on AppVeyor (windows) -## 1.0.1 - 2017-07-29 +### 1.0.1 - 2017-07-29 - qualify the path to plugin.\*.msg to avoid collision -## 1.0.0 - 2017-07-14 +### 1.0.0 - 2017-07-14 - initial release + +[1.0.7]: https://github.com/haraka/haraka-plugin-elasticsearch/releases/tag/1.0.7 diff --git a/README.md b/README.md index cb92ba1..fe8f41c 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,8 @@ curl -X PUT 'http://localhost:9200/_template/haraka_results' -H 'Content-Type: a -[ci-img]: https://github.com/haraka/haraka-plugin-elasticsearch/workflows/Unit%20Tests/badge.svg -[ci-url]: https://github.com/haraka/haraka-plugin-elasticsearch/actions?query=workflow%3A%22Unit+Tests%22 +[ci-img]: https://github.com/haraka/haraka-plugin-elasticsearch/actions/workflows/ci.yml/badge.svg +[ci-url]: https://github.com/haraka/haraka-plugin-elasticsearch/actions/workflows/ci.yml [clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-elasticsearch/badges/gpa.svg [clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-elasticsearch [npm-img]: https://nodei.co/npm/haraka-plugin-elasticsearch.png diff --git a/package.json b/package.json index 36f99d2..6f82700 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "haraka-plugin-elasticsearch", - "version": "1.0.6", + "version": "1.0.7", "description": "Haraka plugin that saves logs to Elasticsearch", "main": "index.js", "scripts": { - "lint": "npx eslint *.js test/*.js", - "lintfix": "npx eslint --fix *.js test/*.js", + "lint": "npx eslint *.js test", + "lintfix": "npx eslint --fix *.js test", "test": "npx mocha" }, "repository": { @@ -28,9 +28,9 @@ "haraka-utils": "*" }, "devDependencies": { - "eslint": "*", + "eslint": ">=8", "eslint-plugin-haraka": "*", "haraka-test-fixtures": "*", - "mocha": "*" + "mocha": ">=9" } }