Skip to content

Commit

Permalink
Only promote build results when on the master branch (#311)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptziegler committed Dec 13, 2023
1 parent 1b40212 commit d199891
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,29 @@ pipeline {
)
}
failure {
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]";
script {
if (env.BRANCH_NAME == 'master') {
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]";
}
}
}
}

}
stage('Deploy') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh -o BatchMode=yes [email protected] rm -rf /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
ssh -o BatchMode=yes [email protected] mkdir -p /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
scp -o BatchMode=yes -r org.eclipse.gef.repository/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/tools/gef/classic/latest
'''
}
}
script {
if (env.BRANCH_NAME == 'master') {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh -o BatchMode=yes [email protected] rm -rf /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
ssh -o BatchMode=yes [email protected] mkdir -p /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
scp -o BatchMode=yes -r org.eclipse.gef.repository/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/tools/gef/classic/latest
'''
}
}
}
}
}
}
}

0 comments on commit d199891

Please sign in to comment.