From 8f88aef3a4e73b52ad8ab4fdc3b672370428f856 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Sat, 7 Dec 2024 01:05:42 +0100 Subject: [PATCH] [Build] Deploy RelEng scripts in master branch build This ensures that releng scripts are always updated on the download-server as soon as they change in the git repository. Furthermore this avoids the need for the separate Jenkins job to deploy the scripts. --- Jenkinsfile | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 77a1be05b68..2a1356e3d86 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { sh 'git submodule foreach "git fetch origin master; git checkout FETCH_HEAD"' } } - stage('Deploy eclipse-platform-parent pom and eclipse-sdk target') { + stage('Deploy parent-pom and SDK-target') { when { anyOf { branch 'master' @@ -31,6 +31,45 @@ pipeline { sh 'mvn clean deploy -f eclipse.platform.releng.prereqs.sdk/pom.xml' } } + stage('Deploy RelEng scripts') { + when { + branch 'master' + } + steps { + sshagent(['projects-storage.eclipse.org-bot-ssh']) { + sh ''' + serverBase='/home/data/httpd/download.eclipse.org/eclipse/' + serverStaging="${serverBase}/relengScripts-staging" + + ssh genie.platform@projects-storage.eclipse.org rm -rf ${serverStaging} + ssh genie.platform@projects-storage.eclipse.org mkdir -p ${serverStaging} + + scp -r production genie.platform@projects-storage.eclipse.org:${serverStaging} + scp -r scripts genie.platform@projects-storage.eclipse.org:${serverStaging} + scp -r cje-production genie.platform@projects-storage.eclipse.org:${serverStaging} + + pushd eclipse.platform.releng.tychoeclipsebuilder/eclipse + scp -r buildScripts genie.platform@projects-storage.eclipse.org:${serverStaging} + popd + + pushd eclipse.platform.releng.tychoeclipsebuilder + scp -r entitlement genie.platform@projects-storage.eclipse.org:${serverStaging} + popd + + #To minimize 'downtime', all files are first transfered to a staging folder on the server, + # then the existing folder is moved to 'disposal' and the 'staging' to the desired target. + # Eventually the previously existing content is deleted with the 'disposal'-folder. + serverTarget="${serverBase}/relengScripts" + serverDisposal="${serverBase}/relengScripts-disposal" + + ssh genie.platform@projects-storage.eclipse.org "\ + mv -f ${serverTarget} ${serverDisposal} ;\ + mv -f ${serverStaging} ${serverTarget} &&\ + rm -rf ${serverDisposal}" + ''' + } + } + } stage('Build') { when { not { branch pattern: "prepare_R.*", comparator: "REGEXP" } } steps {