From d13eec812964320a745c7555db077731c4990434 Mon Sep 17 00:00:00 2001 From: Bastian Widmer Date: Mon, 2 Sep 2019 17:31:41 +0200 Subject: [PATCH 1/4] adding node12 and node12-builder --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c297cdbac8..375cdc7f37 100644 --- a/Makefile +++ b/Makefile @@ -345,14 +345,16 @@ build/solr__6.6-ckan: build/solr__6.6 ####### ####### Node Images are alpine linux based Node images. -nodeimages := node__10 \ - node__9 \ - node__8 \ - node__6 \ - node__10-builder \ - node__9-builder \ - node__8-builder \ - node__6-builder +nodeimages := node_12 \ + node__10 \ + node__9 \ + node__8 \ + node__6 \ + node__12-builder \ + node__10-builder \ + node__9-builder \ + node__8-builder \ + node__6-builder build-nodeimages = $(foreach image,$(nodeimages),build/$(image)) @@ -373,6 +375,7 @@ base-images-with-versions += $(nodeimages) s3-images += node build/node__9 build/node__8 build/node__6: images/commons images/node/Dockerfile +build/node__12-builder: build/node__12 images/node/builder/Dockerfile build/node__10-builder: build/node__10 images/node/builder/Dockerfile build/node__9-builder: build/node__9 images/node/builder/Dockerfile build/node__8-builder: build/node__8 images/node/builder/Dockerfile From 59c175f339640a2f315770a29c735b0e184a9659 Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Mon, 2 Sep 2019 14:42:03 -0500 Subject: [PATCH 2/4] Added missing underscore. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 375cdc7f37..d427ccc466 100644 --- a/Makefile +++ b/Makefile @@ -345,7 +345,7 @@ build/solr__6.6-ckan: build/solr__6.6 ####### ####### Node Images are alpine linux based Node images. -nodeimages := node_12 \ +nodeimages := node__12 \ node__10 \ node__9 \ node__8 \ From 935d353556a47967f0976f329a4c9ce32b2b2e67 Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Mon, 9 Sep 2019 11:12:25 -0500 Subject: [PATCH 3/4] Testing tests for node versions 10 and 12. --- tests/tests/node.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/tests/node.yaml b/tests/tests/node.yaml index fa10e95087..d030c7e5e0 100644 --- a/tests/tests/node.yaml +++ b/tests/tests/node.yaml @@ -4,6 +4,24 @@ vars: testname: "API TOKEN" +- include: rest/branch.yaml + vars: + testname: "NODE 12" + node_version: 12 + git_repo_name: node.git + project: ci-node + branch: node12 + check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}" + +- include: rest/branch.yaml + vars: + testname: "NODE 10" + node_version: 10 + git_repo_name: node.git + project: ci-node + branch: node10 + check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}" + - include: rest/branch.yaml vars: testname: "NODE 8" From 15a06340080de921a5f8004ad694cd0200913f8c Mon Sep 17 00:00:00 2001 From: Chris Davis Date: Mon, 9 Sep 2019 12:04:49 -0500 Subject: [PATCH 4/4] Adding actual test files for node 10 and 12. --- tests/files/node10/.dockerignore | 1 + tests/files/node10/.lagoon.yml | 11 ++ tests/files/node10/Dockerfile | 36 ++++ tests/files/node10/docker-compose.yml | 18 ++ tests/files/node10/index.js | 32 ++++ tests/files/node10/package.json | 12 ++ tests/files/node10/yarn.lock | 247 ++++++++++++++++++++++++++ tests/files/node12/.dockerignore | 1 + tests/files/node12/.lagoon.yml | 11 ++ tests/files/node12/Dockerfile | 36 ++++ tests/files/node12/docker-compose.yml | 18 ++ tests/files/node12/index.js | 32 ++++ tests/files/node12/package.json | 12 ++ tests/files/node12/yarn.lock | 247 ++++++++++++++++++++++++++ 14 files changed, 714 insertions(+) create mode 100644 tests/files/node10/.dockerignore create mode 100644 tests/files/node10/.lagoon.yml create mode 100644 tests/files/node10/Dockerfile create mode 100644 tests/files/node10/docker-compose.yml create mode 100644 tests/files/node10/index.js create mode 100644 tests/files/node10/package.json create mode 100644 tests/files/node10/yarn.lock create mode 100644 tests/files/node12/.dockerignore create mode 100644 tests/files/node12/.lagoon.yml create mode 100644 tests/files/node12/Dockerfile create mode 100644 tests/files/node12/docker-compose.yml create mode 100644 tests/files/node12/index.js create mode 100644 tests/files/node12/package.json create mode 100644 tests/files/node12/yarn.lock diff --git a/tests/files/node10/.dockerignore b/tests/files/node10/.dockerignore new file mode 100644 index 0000000000..b512c09d47 --- /dev/null +++ b/tests/files/node10/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/tests/files/node10/.lagoon.yml b/tests/files/node10/.lagoon.yml new file mode 100644 index 0000000000..eade588656 --- /dev/null +++ b/tests/files/node10/.lagoon.yml @@ -0,0 +1,11 @@ +docker-compose-yaml: docker-compose.yml + +environment_variables: + git_sha: 'true' + +environments: + node10: + routes: + - node: + - customdomain-will-be-main-domain.com + - customdomain-will-be-not-be-main-domain.com diff --git a/tests/files/node10/Dockerfile b/tests/files/node10/Dockerfile new file mode 100644 index 0000000000..18931de976 --- /dev/null +++ b/tests/files/node10/Dockerfile @@ -0,0 +1,36 @@ +ARG IMAGE_REPO +FROM ${IMAGE_REPO:-amazeeio}/node:10-builder as builder +COPY package.json yarn.lock /app/ +RUN yarn install + +FROM ${IMAGE_REPO:-amazeeio}/node:10 +COPY --from=builder /app/node_modules /app/node_modules +COPY . /app/ + +ARG LAGOON_GIT_SHA=0000000000000000000000000000000000000000 +ENV LAGOON_GIT_SHA_BUILDTIME ${LAGOON_GIT_SHA} + +ARG LAGOON_GIT_BRANCH=undefined +ENV LAGOON_GIT_BRANCH_BUILDTIME ${LAGOON_GIT_BRANCH} + +ARG LAGOON_BUILD_TYPE=undefined +ENV LAGOON_BUILD_TYPE_BUILDTIME ${LAGOON_BUILD_TYPE} + +ARG LAGOON_PR_HEAD_BRANCH=undefined +ENV LAGOON_PR_HEAD_BRANCH_BUILDTIME ${LAGOON_PR_HEAD_BRANCH} + +ARG LAGOON_PR_HEAD_SHA=undefined +ENV LAGOON_PR_HEAD_SHA_BUILDTIME ${LAGOON_PR_HEAD_SHA} + +ARG LAGOON_PR_BASE_BRANCH=undefined +ENV LAGOON_PR_BASE_BRANCH_BUILDTIME ${LAGOON_PR_BASE_BRANCH} + +ARG LAGOON_PR_BASE_SHA=undefined +ENV LAGOON_PR_BASE_SHA_BUILDTIME ${LAGOON_PR_BASE_SHA} + +ARG LAGOON_PR_TITLE=undefined +ENV LAGOON_PR_TITLE_BUILDTIME ${LAGOON_PR_TITLE} + +EXPOSE 3000 + +CMD ["node", "index.js"] diff --git a/tests/files/node10/docker-compose.yml b/tests/files/node10/docker-compose.yml new file mode 100644 index 0000000000..44d26bacba --- /dev/null +++ b/tests/files/node10/docker-compose.yml @@ -0,0 +1,18 @@ +version: '2' +services: + node: + networks: + - amazeeio-network + - default + build: + context: . + dockerfile: Dockerfile + labels: + lagoon.type: node + ports: + - "3000:3000" + environment: + - AMAZEEIO_URL=node.docker.amazee.io +networks: + amazeeio-network: + external: true \ No newline at end of file diff --git a/tests/files/node10/index.js b/tests/files/node10/index.js new file mode 100644 index 0000000000..abe11e090c --- /dev/null +++ b/tests/files/node10/index.js @@ -0,0 +1,32 @@ +const express = require('express') +const app = express() + +// Adds a 1 sec delay for all requests +app.use((req, res, next) => setTimeout(next, 1000)) + +app.get('/', function (req, res) { + let result = [] + Object.keys(process.env).map(key => { + result.push(`${key}=${process.env[key]}`) + }) + Object.keys(req.headers).map(key => { + result.push(`${key}=${req.headers[key]}`) + }) + result.sort() + + res.send(result.join("
")) +}) + +const server = app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) + +const startGracefulShutdown = () => { + console.log('Starting shutdown of express...'); + server.close(function () { + console.log('Express shut down.'); + }); +} + +process.on('SIGTERM', startGracefulShutdown); +process.on('SIGINT', startGracefulShutdown); diff --git a/tests/files/node10/package.json b/tests/files/node10/package.json new file mode 100644 index 0000000000..b577e5e022 --- /dev/null +++ b/tests/files/node10/package.json @@ -0,0 +1,12 @@ +{ + "name": "node", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "express": "^4.15.3" + }, + "scripts": { + "start": "node index.js" + } +} diff --git a/tests/files/node10/yarn.lock b/tests/files/node10/yarn.lock new file mode 100644 index 0000000000..d9c4cd4621 --- /dev/null +++ b/tests/files/node10/yarn.lock @@ -0,0 +1,247 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +accepts@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" + dependencies: + mime-types "~2.1.11" + negotiator "0.6.1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +content-disposition@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + +content-type@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + +debug@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.7.tgz#92bad1f6d05bbb6bba22cca88bcd0ec894c2861e" + dependencies: + ms "2.0.0" + +depd@1.1.0, depd@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +encodeurl@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +etag@~1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051" + +express@^4.15.3: + version "4.15.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.15.3.tgz#bab65d0f03aa80c358408972fc700f916944b662" + dependencies: + accepts "~1.3.3" + array-flatten "1.1.1" + content-disposition "0.5.2" + content-type "~1.0.2" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "2.6.7" + depd "~1.1.0" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.0" + finalhandler "~1.0.3" + fresh "0.5.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.1" + path-to-regexp "0.1.7" + proxy-addr "~1.1.4" + qs "6.4.0" + range-parser "~1.2.0" + send "0.15.3" + serve-static "1.12.3" + setprototypeof "1.0.3" + statuses "~1.3.1" + type-is "~1.6.15" + utils-merge "1.0.0" + vary "~1.1.1" + +finalhandler@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.3.tgz#ef47e77950e999780e86022a560e3217e0d0cc89" + dependencies: + debug "2.6.7" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.1" + statuses "~1.3.1" + unpipe "~1.0.0" + +forwarded@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" + +fresh@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.0.tgz#f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e" + +http-errors@~1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257" + dependencies: + depd "1.1.0" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ipaddr.js@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.3.0.tgz#1e03a52fdad83a8bbb2b25cbf4998b4cffcd3dec" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@~2.1.11, mime-types@~2.1.15: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +mime@1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +parseurl@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +proxy-addr@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3" + dependencies: + forwarded "~0.1.0" + ipaddr.js "1.3.0" + +qs@6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + +send@0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/send/-/send-0.15.3.tgz#5013f9f99023df50d1bd9892c19e3defd1d53309" + dependencies: + debug "2.6.7" + depd "~1.1.0" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.0" + fresh "0.5.0" + http-errors "~1.6.1" + mime "1.3.4" + ms "2.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.1" + +serve-static@1.12.3: + version "1.12.3" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.3.tgz#9f4ba19e2f3030c547f8af99107838ec38d5b1e2" + dependencies: + encodeurl "~1.0.1" + escape-html "~1.0.3" + parseurl "~1.3.1" + send "0.15.3" + +setprototypeof@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" + +"statuses@>= 1.3.1 < 2", statuses@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + +type-is@~1.6.15: + version "1.6.15" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.15" + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +utils-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" + +vary@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.1.tgz#67535ebb694c1d52257457984665323f587e8d37" diff --git a/tests/files/node12/.dockerignore b/tests/files/node12/.dockerignore new file mode 100644 index 0000000000..b512c09d47 --- /dev/null +++ b/tests/files/node12/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/tests/files/node12/.lagoon.yml b/tests/files/node12/.lagoon.yml new file mode 100644 index 0000000000..1f8f5898f6 --- /dev/null +++ b/tests/files/node12/.lagoon.yml @@ -0,0 +1,11 @@ +docker-compose-yaml: docker-compose.yml + +environment_variables: + git_sha: 'true' + +environments: + node8: + routes: + - node: + - customdomain-will-be-main-domain.com + - customdomain-will-be-not-be-main-domain.com diff --git a/tests/files/node12/Dockerfile b/tests/files/node12/Dockerfile new file mode 100644 index 0000000000..c1293c12df --- /dev/null +++ b/tests/files/node12/Dockerfile @@ -0,0 +1,36 @@ +ARG IMAGE_REPO +FROM ${IMAGE_REPO:-amazeeio}/node:12-builder as builder +COPY package.json yarn.lock /app/ +RUN yarn install + +FROM ${IMAGE_REPO:-amazeeio}/node:12 +COPY --from=builder /app/node_modules /app/node_modules +COPY . /app/ + +ARG LAGOON_GIT_SHA=0000000000000000000000000000000000000000 +ENV LAGOON_GIT_SHA_BUILDTIME ${LAGOON_GIT_SHA} + +ARG LAGOON_GIT_BRANCH=undefined +ENV LAGOON_GIT_BRANCH_BUILDTIME ${LAGOON_GIT_BRANCH} + +ARG LAGOON_BUILD_TYPE=undefined +ENV LAGOON_BUILD_TYPE_BUILDTIME ${LAGOON_BUILD_TYPE} + +ARG LAGOON_PR_HEAD_BRANCH=undefined +ENV LAGOON_PR_HEAD_BRANCH_BUILDTIME ${LAGOON_PR_HEAD_BRANCH} + +ARG LAGOON_PR_HEAD_SHA=undefined +ENV LAGOON_PR_HEAD_SHA_BUILDTIME ${LAGOON_PR_HEAD_SHA} + +ARG LAGOON_PR_BASE_BRANCH=undefined +ENV LAGOON_PR_BASE_BRANCH_BUILDTIME ${LAGOON_PR_BASE_BRANCH} + +ARG LAGOON_PR_BASE_SHA=undefined +ENV LAGOON_PR_BASE_SHA_BUILDTIME ${LAGOON_PR_BASE_SHA} + +ARG LAGOON_PR_TITLE=undefined +ENV LAGOON_PR_TITLE_BUILDTIME ${LAGOON_PR_TITLE} + +EXPOSE 3000 + +CMD ["node", "index.js"] diff --git a/tests/files/node12/docker-compose.yml b/tests/files/node12/docker-compose.yml new file mode 100644 index 0000000000..44d26bacba --- /dev/null +++ b/tests/files/node12/docker-compose.yml @@ -0,0 +1,18 @@ +version: '2' +services: + node: + networks: + - amazeeio-network + - default + build: + context: . + dockerfile: Dockerfile + labels: + lagoon.type: node + ports: + - "3000:3000" + environment: + - AMAZEEIO_URL=node.docker.amazee.io +networks: + amazeeio-network: + external: true \ No newline at end of file diff --git a/tests/files/node12/index.js b/tests/files/node12/index.js new file mode 100644 index 0000000000..abe11e090c --- /dev/null +++ b/tests/files/node12/index.js @@ -0,0 +1,32 @@ +const express = require('express') +const app = express() + +// Adds a 1 sec delay for all requests +app.use((req, res, next) => setTimeout(next, 1000)) + +app.get('/', function (req, res) { + let result = [] + Object.keys(process.env).map(key => { + result.push(`${key}=${process.env[key]}`) + }) + Object.keys(req.headers).map(key => { + result.push(`${key}=${req.headers[key]}`) + }) + result.sort() + + res.send(result.join("
")) +}) + +const server = app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) + +const startGracefulShutdown = () => { + console.log('Starting shutdown of express...'); + server.close(function () { + console.log('Express shut down.'); + }); +} + +process.on('SIGTERM', startGracefulShutdown); +process.on('SIGINT', startGracefulShutdown); diff --git a/tests/files/node12/package.json b/tests/files/node12/package.json new file mode 100644 index 0000000000..b577e5e022 --- /dev/null +++ b/tests/files/node12/package.json @@ -0,0 +1,12 @@ +{ + "name": "node", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "express": "^4.15.3" + }, + "scripts": { + "start": "node index.js" + } +} diff --git a/tests/files/node12/yarn.lock b/tests/files/node12/yarn.lock new file mode 100644 index 0000000000..d9c4cd4621 --- /dev/null +++ b/tests/files/node12/yarn.lock @@ -0,0 +1,247 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +accepts@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" + dependencies: + mime-types "~2.1.11" + negotiator "0.6.1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +content-disposition@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + +content-type@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + +debug@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.7.tgz#92bad1f6d05bbb6bba22cca88bcd0ec894c2861e" + dependencies: + ms "2.0.0" + +depd@1.1.0, depd@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +encodeurl@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +etag@~1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051" + +express@^4.15.3: + version "4.15.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.15.3.tgz#bab65d0f03aa80c358408972fc700f916944b662" + dependencies: + accepts "~1.3.3" + array-flatten "1.1.1" + content-disposition "0.5.2" + content-type "~1.0.2" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "2.6.7" + depd "~1.1.0" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.0" + finalhandler "~1.0.3" + fresh "0.5.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.1" + path-to-regexp "0.1.7" + proxy-addr "~1.1.4" + qs "6.4.0" + range-parser "~1.2.0" + send "0.15.3" + serve-static "1.12.3" + setprototypeof "1.0.3" + statuses "~1.3.1" + type-is "~1.6.15" + utils-merge "1.0.0" + vary "~1.1.1" + +finalhandler@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.3.tgz#ef47e77950e999780e86022a560e3217e0d0cc89" + dependencies: + debug "2.6.7" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.1" + statuses "~1.3.1" + unpipe "~1.0.0" + +forwarded@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" + +fresh@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.0.tgz#f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e" + +http-errors@~1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257" + dependencies: + depd "1.1.0" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ipaddr.js@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.3.0.tgz#1e03a52fdad83a8bbb2b25cbf4998b4cffcd3dec" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@~2.1.11, mime-types@~2.1.15: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +mime@1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +parseurl@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +proxy-addr@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3" + dependencies: + forwarded "~0.1.0" + ipaddr.js "1.3.0" + +qs@6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + +send@0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/send/-/send-0.15.3.tgz#5013f9f99023df50d1bd9892c19e3defd1d53309" + dependencies: + debug "2.6.7" + depd "~1.1.0" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.0" + fresh "0.5.0" + http-errors "~1.6.1" + mime "1.3.4" + ms "2.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.1" + +serve-static@1.12.3: + version "1.12.3" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.3.tgz#9f4ba19e2f3030c547f8af99107838ec38d5b1e2" + dependencies: + encodeurl "~1.0.1" + escape-html "~1.0.3" + parseurl "~1.3.1" + send "0.15.3" + +setprototypeof@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" + +"statuses@>= 1.3.1 < 2", statuses@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + +type-is@~1.6.15: + version "1.6.15" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.15" + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +utils-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" + +vary@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.1.tgz#67535ebb694c1d52257457984665323f587e8d37"