Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 8531e66

Browse files
committed
Only deploy on master
1 parent e11d6f7 commit 8531e66

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ node {
99
app = docker.build("yogstation/feedback-normalization")
1010
}
1111

12-
stage('Push image') {
13-
docker.withRegistry('https://registry.hub.docker.com', 'yogstation-docker-hub-credentials') {
14-
app.push("${env.BUILD_NUMBER}")
15-
app.push("latest")
12+
if( "${env.BRANCH_NAME}" == "master" ) {
13+
stage('Push image') {
14+
docker.withRegistry('https://registry.hub.docker.com', 'yogstation-docker-hub-credentials') {
15+
app.push("${env.BUILD_NUMBER}")
16+
app.push("latest")
17+
}
1618
}
17-
}
1819

19-
stage('Deploy') {
20-
withKubeConfig([credentialsId: 'yogstation-kubeconf-credentials']) {
21-
sh 'kubectl set image --namespace yogbot deployment/feedback-normalization feedback-normalization=yogstation/feedback-normalization:${BUILD_NUMBER}'
22-
}
20+
stage('Deploy') {
21+
withKubeConfig([credentialsId: 'yogstation-kubeconf-credentials']) {
22+
sh 'kubectl set image --namespace yogbot deployment/feedback-normalization feedback-normalization=yogstation/feedback-normalization:${BUILD_NUMBER}'
23+
}
24+
}
2325
}
2426
}

0 commit comments

Comments
 (0)