Skip to content

Commit ac03e35

Browse files
authored
Only promote build results when on the master branch (#311)
To avoid uploading the artifacts from old branches to the update site, we should make sure that we only do so, when on the master branch.
1 parent 8fa67e7 commit ac03e35

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Jenkinsfile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,29 @@ pipeline {
3535
)
3636
}
3737
failure {
38-
mail bcc: '', body: "<b>GEF Classic: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: GEF Classic -> ${env.JOB_NAME}", to: "[email protected]";
38+
script {
39+
if (env.BRANCH_NAME == 'master') {
40+
mail bcc: '', body: "<b>GEF Classic: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: GEF Classic -> ${env.JOB_NAME}", to: "[email protected]";
41+
}
42+
}
3943
}
4044
}
4145

4246
}
4347
stage('Deploy') {
4448
steps {
45-
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
46-
sh '''
47-
ssh -o BatchMode=yes [email protected] rm -rf /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
48-
ssh -o BatchMode=yes [email protected] mkdir -p /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
49-
scp -o BatchMode=yes -r org.eclipse.gef.repository/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/tools/gef/classic/latest
50-
'''
51-
}
52-
}
49+
script {
50+
if (env.BRANCH_NAME == 'master') {
51+
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
52+
sh '''
53+
ssh -o BatchMode=yes [email protected] rm -rf /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
54+
ssh -o BatchMode=yes [email protected] mkdir -p /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
55+
scp -o BatchMode=yes -r org.eclipse.gef.repository/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/tools/gef/classic/latest
56+
'''
57+
}
58+
}
59+
}
60+
}
5361
}
5462
}
5563
}

0 commit comments

Comments
 (0)