From ff31d98a519aa2fe0df8a82f16085dd9d49e78cc Mon Sep 17 00:00:00 2001 From: Taylor Christie Date: Tue, 9 Apr 2019 11:04:52 -0600 Subject: [PATCH] fixed ordering in steps, optimized npm install --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cfd137..0ab0ddb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,20 +11,20 @@ podTemplate(label: label, inheritFrom: 'base', , containers: [ } stage('Install Dependencies') { container('base') { - sh "npm ci" + sh "npm ci --only=production" sh "npm install -g typescript" } } - stage('Run unit tests') { - container('base') { - sh "npm test" - } - } stage('Build the Project') { container('base') { sh "tsc" } } + stage('Run unit tests') { + container('base') { + sh "npm test" + } + } stage('Login to Dockerhub') { withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) { container('base') { @@ -34,13 +34,13 @@ podTemplate(label: label, inheritFrom: 'base', , containers: [ } stage('Build the Docker Image') { container('base') { - sh "make build" + sh "make build branch=${BRANCH_NAME}" } } stage('Push the Docker Image') { container('base') { - sh "make push" + sh "make push branch=${BRANCH_NAME}" } } }