From 75c0b5005f167bf11f74300fb6e685ae378cebeb Mon Sep 17 00:00:00 2001 From: klu909 Date: Mon, 12 Dec 2022 16:28:49 -0800 Subject: [PATCH] feat(2683): nodejs upgrade BREAKING CHANGE: Node 18 upgrade && eslint upgrade --- index.js | 2 ++ package.json | 34 +++++++++++++++------------------- screwdriver.yaml | 2 +- test/index.test.js | 9 +++++++-- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/index.js b/index.js index 2863e59..8658ebf 100644 --- a/index.js +++ b/index.js @@ -128,6 +128,7 @@ class DockerExecutor extends Executor { * Starts a docker build * @method _start * @param {Object} config A configuration object + * @param {String} [config.apiUri] screwdriver base api uri * @param {Integer} config.buildId ID for the build * @param {String} config.container Container for the build to run in * @param {String} config.token JWT for the Build @@ -218,6 +219,7 @@ class DockerExecutor extends Executor { * Stop a docker build * @method _stop * @param {Object} config A configuration object + * @param {String} [config.apiUri] screwdriver base api uri * @param {Integer} config.buildId ID for the build * @return {Promise} */ diff --git a/package.json b/package.json index 0a07c28..5000153 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { "name": "screwdriver-executor-docker", - "version": "5.0.0", + "version": "6.0.0", "description": "Docker Swarm Executor for Screwdriver", "main": "index.js", "scripts": { "pretest": "eslint .", - "test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true", - "semantic-release": "semantic-release pre && npm publish && semantic-release post" + "test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true" }, "repository": { "type": "git", - "url": "git@github.com:screwdriver-cd/executor-docker.git" + "url": "git+https://github.com/screwdriver-cd/executor-docker.git" }, "homepage": "https://github.com/screwdriver-cd/executor-docker", "bugs": "https://github.com/screwdriver-cd/screwdriver/issues", @@ -30,27 +29,24 @@ "Tiffany Kyi " ], "release": { - "debug": false, - "verifyConditions": { - "path": "./node_modules/semantic-release/src/lib/plugin-noop.js" - } + "debug": false }, "devDependencies": { - "chai": "^4.2.0", - "eslint": "^7.7.0", - "eslint-config-screwdriver": "^5.0.4", - "mocha": "^8.2.1", + "chai": "^4.3.7", + "eslint": "^8.28.0", + "eslint-config-screwdriver": "^7.0.0", + "mocha": "^10.1.0", "mocha-multi-reporters": "^1.5.1", "mocha-sonarqube-reporter": "^1.0.2", - "mockery": "^2.0.0", - "nyc": "^15.0.0", - "sinon": "^9.0.3" + "nyc": "^15.1.0", + "mockery": "^2.1.0", + "sinon": "^15.0.0" }, "dependencies": { - "@hapi/hoek": "^9.0.4", - "circuit-fuses": "^4.0.4", + "@hapi/hoek": "^10.0.1", + "circuit-fuses": "^5.0.0", "docker-parse-image": "^3.0.1", - "dockerode": "^2.5.8", - "screwdriver-executor-base": "^8.0.0" + "dockerode": "^3.3.4", + "screwdriver-executor-base": "^9.0.0" } } diff --git a/screwdriver.yaml b/screwdriver.yaml index 046a496..554ea6c 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -1,5 +1,5 @@ shared: - image: node:12 + image: node:18 jobs: main: diff --git a/test/index.test.js b/test/index.test.js index 2b2a671..6824b62 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,12 +1,12 @@ 'use strict'; -const assert = require('chai').assert; +const { assert } = require('chai'); const sinon = require('sinon'); const mockery = require('mockery'); sinon.assert.expose(assert, { prefix: '' }); -describe('index', function() { +describe('index', function () { // Time not important. Only life important. this.timeout(5000); @@ -403,6 +403,7 @@ describe('index', function() { describe('stop', () => { const buildId = 1992; + const apiUri = 'https://api.sd.cd'; it('finds and removes the containers', () => { const findArgs = { @@ -419,6 +420,7 @@ describe('index', function() { return executor .stop({ + apiUri, buildId }) .then(() => { @@ -453,6 +455,7 @@ describe('index', function() { return executor .stop({ + apiUri, buildId }) .then(() => { @@ -467,6 +470,7 @@ describe('index', function() { return executor .stop({ + apiUri, buildId }) .then(() => { @@ -482,6 +486,7 @@ describe('index', function() { return executor .stop({ + apiUri, buildId }) .then(() => {