Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added some changes in Jenkinsfile #173

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,41 @@ node() {
}

stage('docker-build') {
sh '''
docker build -t $docker_server/$docker_repo:$commit_id .
'''
if (env.BRANCH_NAME == 'staging') {
sh '''
docker build -t $docker_server/$docker_repo:latest .
'''
}
sh '''
docker build -t $docker_server/$docker_repo:$commit_id .
'''
if (env.BRANCH_NAME == 'master') {
sh '''
docker build -t $docker_server/$docker_repo:latest .
'''
} else if (env.BRANCH_NAME == 'staging'){
sh '''
docker build -t $docker_server/$docker_repo:staging .
'''
}
}

stage('docker-push') {
sh '''
docker push $docker_server/$docker_repo:$commit_id
'''
if (env.BRANCH_NAME == 'staging') {
sh '''
docker push $docker_server/$docker_repo:staging
'''
}
sh '''
docker push $docker_server/$docker_repo:$commit_id
'''
if (env.BRANCH_NAME == 'master') {
sh '''
docker push $docker_server/$docker_repo:latest
'''
} else if (env.BRANCH_NAME == 'staging'){
sh '''
docker push $docker_server/$docker_repo:staging
'''
}
}

stage('Start deploy job with latest tag') {
if (env.BRANCH_NAME == 'staging') {
build job: 'UAT/deploy-uat/ulp-bff/', parameters: [string(name: 'tag', value: 'staging')]
if (env.BRANCH_NAME == 'master') {
build job: 'ULP/deploy-staging/ulp-bff/', parameters: [string(name: 'tag', value: 'latest')]
}
else if (env.BRANCH_NAME == 'staging'){
build job: 'UAT/deploy-staging/uat-bff/', parameters: [string(name: 'tag', value: 'staging')]
}
}

}