Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to Dockerfile in Jenkins pipeline
- Loading branch information
Showing
5 changed files
with
123 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,95 +1,93 @@ | |||
pipeline { | pipeline { | ||
|
|
||
agent any | agent none | ||
|
|
||
stages { | stages { | ||
stage('Run Tests') { | |||
parallel { | |||
|
|
||
stage('Install Packages') { | stage('Test on Node.js 8') { | ||
tools { | agent { | ||
nodejs 'NodeJS 8' | dockerfile { | ||
} | filename 'node8.Dockerfile' | ||
steps { | dir 'dockerfiles' | ||
timeout(10) { | } | ||
retry(3) { | |||
sh 'npm install --unsafe-perm' | |||
} | } | ||
} | steps { | ||
} | timeout(20) { | ||
} | retry(2) { | ||
|
sh 'node --version' | ||
stage('Test node 8') { | sh 'npm --version' | ||
tools { | sh 'npm install --unsafe-perm' | ||
nodejs 'NodeJS 8' | sh 'npm test' | ||
} | publishCoverage adapters: [coberturaAdapter('output/coverage/jest/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD') | ||
steps { | } | ||
timeout(1) { | } | ||
retry(3) { | |||
sh 'node --version' | |||
sh 'npm --version' | |||
sh 'npm test' | |||
} | } | ||
} | } | ||
} | |||
} | |||
|
|
||
stage('Test node 10') { | stage('Test on Node.js 10') { | ||
tools { | agent { | ||
nodejs 'NodeJS 10' | dockerfile { | ||
} | filename 'node10.Dockerfile' | ||
steps { | dir 'dockerfiles' | ||
timeout(1) { | } | ||
retry(3) { | } | ||
sh 'node --version' | steps { | ||
sh 'npm --version' | timeout(20) { | ||
sh 'npm test' | retry(2) { | ||
sh 'node --version' | |||
sh 'npm --version' | |||
sh 'npm install --unsafe-perm' | |||
sh 'npm test' | |||
publishCoverage adapters: [coberturaAdapter('output/coverage/jest/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD') | |||
} | |||
} | |||
} | } | ||
} | } | ||
} | |||
} | |||
|
|
||
stage('Test node 11') { | stage('Test on Node.js 11') { | ||
tools { | agent { | ||
nodejs 'NodeJS 11' | dockerfile { | ||
} | filename 'node11.Dockerfile' | ||
steps { | dir 'dockerfiles' | ||
timeout(1) { | } | ||
retry(3) { | } | ||
sh 'node --version' | steps { | ||
sh 'npm --version' | timeout(20) { | ||
sh 'npm test' | retry(2) { | ||
sh 'node --version' | |||
sh 'npm --version' | |||
sh 'npm install --unsafe-perm' | |||
sh 'npm test' | |||
publishCoverage adapters: [coberturaAdapter('output/coverage/jest/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD') | |||
} | |||
} | |||
} | } | ||
} | } | ||
} | |||
} | |||
|
|
||
stage('Test node 12'){ | stage('Test on Node.js 12') { | ||
tools { | agent { | ||
nodejs 'NodeJS 12' | dockerfile { | ||
} | filename 'node12.Dockerfile' | ||
steps { | dir 'dockerfiles' | ||
timeout(1) { | } | ||
retry(3) { | } | ||
sh 'node --version' | steps { | ||
sh 'npm --version' | timeout(20) { | ||
sh 'npm test' | retry(2) { | ||
sh 'node --version' | |||
sh 'npm --version' | |||
sh 'npm install --unsafe-perm' | |||
sh 'npm test' | |||
publishCoverage adapters: [coberturaAdapter('output/coverage/jest/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD') | |||
} | |||
} | |||
} | } | ||
} | } | ||
} | |||
} | |||
|
|
||
stage('Code Coverage') { | |||
steps { | |||
//cobertura autoUpdateHealth: false, autoUpdateStability: false, classCoverageTargets: '80, 0, 40', coberturaReportFile: 'output/coverage/jest/cobertura-coverage.xml', conditionalCoverageTargets: '80, 0, 40', enableNewApi: true, failUnhealthy: false, failUnstable: false, fileCoverageTargets: '80, 0, 40', lineCoverageTargets: '80, 0, 40', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 40', onlyStable: false, packageCoverageTargets: '80, 0, 40', sourceEncoding: 'ASCII', zoomCoverageChart: false | |||
publishCoverage adapters: [coberturaAdapter('output/coverage/jest/cobertura-coverage.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD') | |||
} | } | ||
} | } | ||
|
|||
} | |||
|
|||
post { | |||
always { | |||
cleanWs() | |||
} | |||
} | } | ||
|
|
||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
# A minimal Docker image with Node and Puppeteer | |||
# | |||
# Based upon: | |||
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | |||
|
|||
FROM node:10-stretch | |||
|
|||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |||
&& apt-get update \ | |||
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ | |||
--no-install-recommends \ | |||
&& rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
# A minimal Docker image with Node and Puppeteer | |||
# | |||
# Based upon: | |||
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | |||
|
|||
FROM node:11-stretch | |||
|
|||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |||
&& apt-get update \ | |||
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ | |||
--no-install-recommends \ | |||
&& rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
# A minimal Docker image with Node and Puppeteer | |||
# | |||
# Based upon: | |||
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | |||
|
|||
FROM node:12-stretch | |||
|
|||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |||
&& apt-get update \ | |||
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ | |||
--no-install-recommends \ | |||
&& rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
# A minimal Docker image with Node and Puppeteer | |||
# | |||
# Based upon: | |||
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | |||
|
|||
FROM node:8-stretch | |||
|
|||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |||
&& apt-get update \ | |||
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ | |||
--no-install-recommends \ | |||
&& rm -rf /var/lib/apt/lists/* |