File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,31 @@ pipeline {
1414 MAJOR_VERSION = " 2"
1515 }
1616 stages {
17- stage(' Prepare' ) {
17+ stage(' Build PR' ) {
18+ when {
19+ changeRequest()
20+ }
1821 steps {
19- sh ' docker pull $DOCKER_CI_TOOLS'
22+ ansiColor(' xterm' ) {
23+ // Codebase
24+ sh ' docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE yarn install'
25+ sh ' docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE npm run-script build'
26+ sh ' rm -rf node_modules'
27+ sh ' docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE yarn install --prod'
28+ sh ' docker run --rm -v $(pwd):/data $DOCKER_CI_TOOLS node-prune'
29+
30+ // Docker Build
31+ sh ' docker build --pull --no-cache --squash --compress -t $TEMP_IMAGE .'
32+
33+ // Private Registry
34+ sh ' docker tag $TEMP_IMAGE $DOCKER_PRIVATE_REGISTRY/$IMAGE:$BRANCH_NAME'
35+ withCredentials([usernamePassword(credentialsId : ' jc21-private-registry' , passwordVariable : ' dpass' , usernameVariable : ' duser' )]) {
36+ sh " docker login -u '${ duser} ' -p '$dpass ' $DOCKER_PRIVATE_REGISTRY "
37+ sh ' docker push $DOCKER_PRIVATE_REGISTRY/$IMAGE:$BRANCH_NAME'
38+ }
39+
40+ sh ' docker rmi $TEMP_IMAGE'
41+ }
2042 }
2143 }
2244 stage(' Build Develop' ) {
You can’t perform that action at this time.
0 commit comments