Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Use same docker image for building as prod
Browse files Browse the repository at this point in the history
  • Loading branch information
jc21 committed Nov 2, 2018
1 parent c92ccf2 commit 01f13a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ pipeline {
TAG_VERSION = getPackageVersion()
}
stages {
stage('Prepare') {
steps {
sh 'docker pull node:9-slim'
}
}
stage('Build') {
steps {
// Codebase
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $DOCKER_NODE yarn install --registry=$NPM_LOCAL_REGISTRY'
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $DOCKER_NODE npm run-script build'
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app node:9-slim yarn install --registry=$NPM_LOCAL_REGISTRY'
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app node:9-slim npm run-script build'
sh 'rm -rf node_modules'
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $DOCKER_NODE yarn install --prod --registry=$NPM_LOCAL_REGISTRY'
sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app node:9-slim yarn install --prod --registry=$NPM_LOCAL_REGISTRY'
sh 'docker run --rm -v $(pwd):/data $DOCKER_CI_TOOLS node-prune'

// Docker Build
Expand Down

0 comments on commit 01f13a7

Please sign in to comment.