Added Jenkinsfile 10
This commit is contained in:
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user