Skip to content

Commit

Permalink
CI: run addon-linter after build
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Feb 7, 2018
1 parent e8d07f7 commit 0df4f31
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
RUN npm run ci:install
ENV PATH="/usr/src/app/node_modules/.bin:${PATH}"
COPY . /usr/src/app
26 changes: 19 additions & 7 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
node(label: 'linux') {
stage('Checkout') {
stage('git:checkout') {
checkout scm
sh 'printenv'
}
stage('ci:install') {
sh 'docker build -t ipfs-companion .'
sh 'docker build -t ipfs-companion:${JOB_BASE_NAME}-${BUILD_NUMBER} .'
}
catchError {
stage('ci:test') {
sh 'docker run -i -v $(pwd)/test/data:/usr/src/app/test/data -e JUNIT_REPORT_PATH=test/data/report.xml ipfs-companion npm run ci:test'
sh 'docker run -i --name ipfs-companion-test-${JOB_BASE_NAME}-${BUILD_NUMBER} -e JUNIT_REPORT_PATH=test/report.xml ipfs-companion:${JOB_BASE_NAME}-${BUILD_NUMBER} npm run ci:test'
sh 'docker cp ipfs-companion-test-${JOB_BASE_NAME}-${BUILD_NUMBER}:/usr/src/app/test/report.xml test/report.xml || true' // copy test report
}
}
junit allowEmptyResults: true, testResults: 'test/data/report.xml'
stage('ci:build') {
sh 'docker run -i -v $(pwd)/build:/usr/src/app/build ipfs-companion npm run ci:build'
archiveArtifacts artifacts: 'build/*.zip', fingerprint: true
sh 'docker rm ipfs-companion-test-${JOB_BASE_NAME}-${BUILD_NUMBER}'
junit allowEmptyResults: true, testResults: 'test/report.xml'
catchError {
stage('ci:build') {
sh 'docker run -i --name ipfs-companion-build-${JOB_BASE_NAME}-${BUILD_NUMBER} ipfs-companion:${JOB_BASE_NAME}-${BUILD_NUMBER} npm run ci:build'
sh 'docker cp ipfs-companion-build-${JOB_BASE_NAME}-${BUILD_NUMBER}:/usr/src/app/build/ . || true' // copy package
sh 'docker cp ipfs-companion-build-${JOB_BASE_NAME}-${BUILD_NUMBER}:/usr/src/app/add-on/ . || true' // needed for lint:web-ext
archiveArtifacts artifacts: 'build/*.zip', fingerprint: true
}
stage('lint:web-ext') {
sh 'docker run -i --rm -v $(pwd)/add-on:/usr/src/app/add-on ipfs-companion:${JOB_BASE_NAME}-${BUILD_NUMBER} npm run lint:web-ext'
}
}
sh 'docker rm ipfs-companion-build-${JOB_BASE_NAME}-${BUILD_NUMBER}'
sh 'docker rmi -f ipfs-companion:${JOB_BASE_NAME}-${BUILD_NUMBER}'
}

0 comments on commit 0df4f31

Please sign in to comment.