Added Jenkinsfile 10

This commit is contained in:
Sebastian Seedorf
2021-04-19 12:05:03 +02:00
parent e0fd6b0c36
commit bf5eacace5
2 changed files with 16 additions and 8 deletions

16
Jenkinsfile vendored
View File

@@ -27,10 +27,10 @@ node {
sh 'rm GIT_COMMIT'
def jobName = env.JOB_NAME.tokenize('/')
print env.jobName
env.DOCKER_NAME="${jobName[0]}/${jobName[1]}:${env.BRANCH_NAME}-${env.GIT_COMMIT}"
env.NODEJS_HOME = "${tool 'node14'}"
env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
env.DOCKER_NAME="${jobName[0]}/${jobName[1]}:${env.BRANCH_NAME}-${env.GIT_COMMIT}"
def customImage
@@ -57,6 +57,20 @@ node {
}
stage('Build Prod'){
env.NODE_ENV = "production"
print "Environment will be : ${env.NODE_ENV}"
sh 'node -v'
sh 'npm prune'
sh 'npm install'
sh './node_modules/.bin/tsc'
sh 'rm node_modules -rf'
sh 'npm install --only=production'
}
stage('Build Docker'){
customImage = docker.build(env.DOCKER_NAME)