diff --git a/releng/download/releases/10.6/compositeArtifacts.xml b/releng/download/releases/10.6/compositeArtifacts.xml new file mode 100644 index 00000000000..73eb331d4df --- /dev/null +++ b/releng/download/releases/10.6/compositeArtifacts.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/releng/download/releases/10.6/compositeContent.xml b/releng/download/releases/10.6/compositeContent.xml new file mode 100644 index 00000000000..0da22b0c908 --- /dev/null +++ b/releng/download/releases/10.6/compositeContent.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/releng/download/releases/10.7/compositeArtifacts.xml b/releng/download/releases/10.7/compositeArtifacts.xml new file mode 100644 index 00000000000..3cb1087b6ea --- /dev/null +++ b/releng/download/releases/10.7/compositeArtifacts.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/releng/download/releases/10.7/compositeContent.xml b/releng/download/releases/10.7/compositeContent.xml new file mode 100644 index 00000000000..6d2ead629cf --- /dev/null +++ b/releng/download/releases/10.7/compositeContent.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/releng/download/releases/latest/compositeArtifacts.xml b/releng/download/releases/latest/compositeArtifacts.xml new file mode 100644 index 00000000000..6e3765f6e47 --- /dev/null +++ b/releng/download/releases/latest/compositeArtifacts.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/releng/download/releases/latest/compositeContent.xml b/releng/download/releases/latest/compositeContent.xml new file mode 100644 index 00000000000..c3c052aa4a9 --- /dev/null +++ b/releng/download/releases/latest/compositeContent.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/releng/promote-a-build.Jenkinsfile b/releng/promote-a-build.Jenkinsfile new file mode 100644 index 00000000000..d286ad47b71 --- /dev/null +++ b/releng/promote-a-build.Jenkinsfile @@ -0,0 +1,27 @@ +// Based on https://wiki.eclipse.org/Jenkins#Pipeline_job_without_custom_pod_template +pipeline { + agent any + parameters { + booleanParam(defaultValue: true, description: 'Do a dry run of the build. All commands will be echoed.First run with this on, then when you are sure it is right, choose rebuild in the passing job and uncheck this box', name: 'DRY_RUN') + booleanParam(defaultValue: true, description: 'Include CDT standalone debugger when publishing (if applicable)', name: 'STANDALONE') + booleanParam(defaultValue: false, description: 'Publish only the standalon debugger. This is used to add the standalone debugger from a different job to the already published CDT release', name: 'STANDALONE_ONLY') + string(defaultValue: '9.8', description: 'The major and minor version of CDT being released (e.g. 9.7, 9.8, 10.0).', name: 'MINOR_VERSION') + string(defaultValue: 'cdt-9.8.0', description: 'The full name of this release (e.g. cdt-9.4.2, cdt-9.5.0-rc1, cdt-9.5.0-photon-m7, cdt-9.5.0-photon-rc1)', name: 'MILESTONE') + string(defaultValue: 'cdt/job/main', description: 'The CI job name being promoted from (e.g. cdt/job/cdt_10_7, cdt/job/main', name: 'CDT_JOB_NAME') + string(defaultValue: '12345', description: 'The CI build number being promoted from', name: 'CDT_BUILD_NUMBER') + choice(choices: ['releases', 'builds'], description: 'Publish location (releases or builds)', name: 'RELEASE_OR_BUILD') + } + options { + timestamps() + disableConcurrentBuilds() + } + stages { + stage('Upload') { + steps { + sshagent ( ['projects-storage.eclipse.org-bot-ssh']) { + sh './releng/scripts/promote-a-build.sh' + } + } + } + } +} diff --git a/releng/promote-files-to-download.Jenkinsfile b/releng/promote-files-to-download.Jenkinsfile new file mode 100644 index 00000000000..db33469aeb3 --- /dev/null +++ b/releng/promote-files-to-download.Jenkinsfile @@ -0,0 +1,19 @@ +// Based on https://wiki.eclipse.org/Jenkins#Pipeline_job_without_custom_pod_template +pipeline { + agent any + parameters { + booleanParam(defaultValue: true, description: 'Do a dry run of the build. All commands will be echoed.First run with this on, then when you are sure it is right, choose rebuild in the passing job and uncheck this box', name: 'DRY_RUN') + } + options { + timestamps() + } + stages { + stage('Upload') { + steps { + sshagent ( ['projects-storage.eclipse.org-bot-ssh']) { + sh './scripts/promote-files-to-download.sh' + } + } + } + } +} diff --git a/releng/scripts/cdt-standalone-php-template b/releng/scripts/cdt-standalone-php-template new file mode 100644 index 00000000000..ec85d93f6ef --- /dev/null +++ b/releng/scripts/cdt-standalone-php-template @@ -0,0 +1,71 @@ +0) { ?> + + + +CDT 9.4.0 stand-alone RCP debugger + + +\n"; +echo "

CDT 9.4.0 stand-alone RCP debugger

"; +sort($files); +foreach ($files as $file) { + $cnt++; + if ($file != ".htaccess" && false===strpos($file,"index.") && $file != "CVS") + { + if (is_file($file)) + { + $downloadSize = filesize("$file"); + echo ' • ' . $file. ' (' . pretty_size($downloadSize) . ')'; + } + else + { + echo ' • ' . $file. ''; + } + } +} +echo "\n"; +} else { + echo "No files found!"; +} +print "

 

"; + +function loadDirSimple($dir,$ext,$type) { // 1D array + $stuff = array(); + if (is_dir($dir) && is_readable($dir)) { + $handle=opendir($dir); + while (($file = readdir($handle))!==false) { + if ( ($ext=="" || preg_match("/".$ext."$/",$file)) && $file!=".." && $file!=".") { + if (($type=="f" && is_file($file)) || ($type=="d" && is_dir($file))) { + $stuff[] = "$file"; + } + } + } + closedir($handle); + } + return $stuff; +} + +function pretty_size($bytes) +{ + $sufs = array("B", "K", "M", "G", "T", "P"); //we shouldn't be larger than 999.9 petabytes any time soon, hopefully + $suf = 0; + + while($bytes >= 1000) + { + $bytes /= 1024; + $suf++; + } + + return sprintf("%3.1f%s", $bytes, $sufs[$suf]); +} +?> diff --git a/releng/scripts/promote-a-build.sh b/releng/scripts/promote-a-build.sh new file mode 100644 index 00000000000..7cb833c4d80 --- /dev/null +++ b/releng/scripts/promote-a-build.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +set -u # run with unset flag error so that missing parameters cause build failure +set -e # error out on any failed commands +set -x # echo all commands used for debugging purposes + +SSHUSER="genie.cdt@projects-storage.eclipse.org" +SSH="ssh ${SSHUSER}" +SCP="scp" +DOWNLOAD=/home/data/httpd/download.eclipse.org/tools/cdt/$RELEASE_OR_BUILD/$MINOR_VERSION/$MILESTONE +ARTIFACTS=https://ci.eclipse.org/cdt/job/$CDT_JOB_NAME/$CDT_BUILD_NUMBER/artifact +INDEX_PHP_FOR_RCP=scripts/cdt-standalone-php-template +ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.repo/target + +echo Using download location root of $DOWNLOAD +echo Using artifacts location root of $ARTIFACTS + + + +echo Testing to make sure artifacts location is sane +wget -q --output-document=/dev/null $ARTIFACTS + +ECHO=echo +if [ "$DRY_RUN" == "false" ]; then + ECHO="" +else + echo Dry run of build: +fi + + +# The STANDALONE_ONLY flag is used to publish the standalone debugger from a +# different job (e.g. cdt-9.9-standalone-debugger job) after the main +# build has been published +if [ "$STANDALONE_ONLY" == "false" ]; then + echo Testing to make sure we are publishing to a new directory + $SSH "test ! -e $DOWNLOAD" + $ECHO $SSH "mkdir -p $DOWNLOAD" + + $ECHO $SSH "cd $DOWNLOAD && \ + wget -q $ARTIFACTS_REPO_TARGET/repository/*zip*/repository.zip && \ + unzip -q repository.zip && \ + mv repository/* . && \ + rm -r repository repository.zip" + + $ECHO $SSH "cd $DOWNLOAD && \ + wget -q $ARTIFACTS_REPO_TARGET/org.eclipse.cdt.repo.zip && \ + mv org.eclipse.cdt.repo.zip $MILESTONE.zip" +fi + +# promote standalone debugger +if [ "$STANDALONE" == "true" ]; then + $ECHO $SSH "mkdir -p $DOWNLOAD/rcp" + + $ECHO $SSH "cd $DOWNLOAD/rcp && \ + wget -q $ARTIFACTS/debug/org.eclipse.cdt.debug.application.product/target/products/*zip*/products.zip && \ + unzip -q products.zip && \ + mv products/* ." + + if [ "$ECHO" == "echo" ]; then + # if there is a better way to handle echoing the pipeline, let me (Jonah) know + $ECHO Setting up index.php pipeline + else + cat $INDEX_PHP_FOR_RCP | sed "-es,CDT 9.4.0,$(echo $MILESTONE | sed '-es@cdt-@CDT @')," | $SSH "cat - > $DOWNLOAD/rcp/index.php" + fi + $ECHO $SSH "cd $DOWNLOAD/rcp && \ + rm -r products products.zip" + + $ECHO $SSH "mkdir $DOWNLOAD/rcp-repository" + $ECHO $SSH "cd $DOWNLOAD/rcp-repository && \ + wget -q $ARTIFACTS/debug/org.eclipse.cdt.debug.application.product/target/repository/*zip*/repository.zip && \ + unzip -q repository.zip && \ + mv repository/* . && \ + rm -r repository repository.zip" +fi diff --git a/releng/scripts/promote-files-to-download.sh b/releng/scripts/promote-files-to-download.sh new file mode 100644 index 00000000000..8929bffa73f --- /dev/null +++ b/releng/scripts/promote-files-to-download.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -u # run with unset flag error so that missing parameters cause build failure +set -e # error out on any failed commands +set -x # echo all commands used for debugging purposes + +SSHUSER="genie.cdt@projects-storage.eclipse.org" +SSH="ssh ${SSHUSER}" +SCP="scp" +DOWNLOAD=/home/data/httpd/download.eclipse.org/tools/cdt + +ECHO=echo +if [ "$DRY_RUN" == "false" ]; then + ECHO="" +else + echo Dry run of build: +fi + +# Rather than putting in infra/coding to make this a fully generic script with parameters, +# just list out what needs to be copied where +$ECHO $SSH mkdir -p "${DOWNLOAD}/releases/latest/" +$ECHO $SCP ./releng/download/releases/latest/* "${SSHUSER}:${DOWNLOAD}/releases/latest/" +$ECHO $SCP ./releng/download/releases/10.6/* "${SSHUSER}:${DOWNLOAD}/releases/10.6/" +$ECHO $SCP ./releng/download/releases/10.7/* "${SSHUSER}:${DOWNLOAD}/releases/10.7/"