Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar5526 authored Jul 13, 2023
1 parent 1fbd232 commit 072742a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node() {
properties([
parameters([
string(name: 'docker_repo', defaultValue: 'samagrax-rcw/credential', description: 'Docker Image Name'),
string(name: 'docker_server', defaultValue: "$docker_registry", description: 'Docker Registry URL'),
string(name: 'docker_registry', defaultValue: "$docker_registry", description: 'Docker Registry URL'),
])
])
}
Expand All @@ -16,22 +16,22 @@ node() {

stage('docker-build') {
sh '''
docker build -f Dockerfile -t $docker_server/$docker_repo:$commit_id .
docker build -f Dockerfile -t $docker_registry/$docker_repo:$commit_id .
'''
if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'master') {
sh '''
docker build -f Dockerfile -t $docker_server/$docker_repo:latest .
docker build -f Dockerfile -t $docker_registry/$docker_repo:latest .
'''
}
}

stage('docker-push') {
sh '''
docker push $docker_server/$docker_repo:$commit_id
docker push $docker_registry/$docker_repo:$commit_id
'''
if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'master') {
sh '''
docker push $docker_server/$docker_repo:latest
docker push $docker_registry/$docker_repo:latest
'''
}
}
Expand Down

0 comments on commit 072742a

Please sign in to comment.