mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
[releng] Migrate promote build releng to main CDT repo
This commit is contained in:
parent
42a7aa82d6
commit
b334b94bae
11 changed files with 291 additions and 0 deletions
14
releng/download/releases/10.6/compositeArtifacts.xml
Normal file
14
releng/download/releases/10.6/compositeArtifacts.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeArtifactRepository version='1.0.0'?>
|
||||
<repository name='CDT 10.6 Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1652784216989'/>
|
||||
</properties>
|
||||
<children size='3'>
|
||||
<child location='cdt-10.6.0'/>
|
||||
<child location='cdt-10.6.1'/>
|
||||
<child location='cdt-10.6.2'/>
|
||||
</children>
|
||||
</repository>
|
14
releng/download/releases/10.6/compositeContent.xml
Normal file
14
releng/download/releases/10.6/compositeContent.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeMetadataRepository version='1.0.0'?>
|
||||
<repository name='CDT 10.6 Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1652784216989'/>
|
||||
</properties>
|
||||
<children size='3'>
|
||||
<child location='cdt-10.6.0'/>
|
||||
<child location='cdt-10.6.1'/>
|
||||
<child location='cdt-10.6.2'/>
|
||||
</children>
|
||||
</repository>
|
12
releng/download/releases/10.7/compositeArtifacts.xml
Normal file
12
releng/download/releases/10.7/compositeArtifacts.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeArtifactRepository version='1.0.0'?>
|
||||
<repository name='CDT 10.7 Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1654707443791'/>
|
||||
</properties>
|
||||
<children size='3'>
|
||||
<child location='cdt-10.7.1'/>
|
||||
</children>
|
||||
</repository>
|
12
releng/download/releases/10.7/compositeContent.xml
Normal file
12
releng/download/releases/10.7/compositeContent.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeMetadataRepository version='1.0.0'?>
|
||||
<repository name='CDT 10.7 Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1654707443791'/>
|
||||
</properties>
|
||||
<children size='3'>
|
||||
<child location='cdt-10.7.1'/>
|
||||
</children>
|
||||
</repository>
|
12
releng/download/releases/latest/compositeArtifacts.xml
Normal file
12
releng/download/releases/latest/compositeArtifacts.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeArtifactRepository version='1.0.0'?>
|
||||
<repository name='CDT Latest Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1654707443791'/>
|
||||
</properties>
|
||||
<children size='1'>
|
||||
<child location='../10.7'/>
|
||||
</children>
|
||||
</repository>
|
12
releng/download/releases/latest/compositeContent.xml
Normal file
12
releng/download/releases/latest/compositeContent.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?compositeMetadataRepository version='1.0.0'?>
|
||||
<repository name='CDT Latest Update Site'
|
||||
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
|
||||
<properties size='1'>
|
||||
<!-- timestamp made with date +%s%3N -->
|
||||
<property name='p2.timestamp' value='1654707443791'/>
|
||||
</properties>
|
||||
<children size='1'>
|
||||
<child location='../10.7'/>
|
||||
</children>
|
||||
</repository>
|
27
releng/promote-a-build.Jenkinsfile
Normal file
27
releng/promote-a-build.Jenkinsfile
Normal file
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
releng/promote-files-to-download.Jenkinsfile
Normal file
19
releng/promote-files-to-download.Jenkinsfile
Normal file
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
71
releng/scripts/cdt-standalone-php-template
Normal file
71
releng/scripts/cdt-standalone-php-template
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
$thisDir = preg_replace("#(.+/)([^/]+$)#","$1",$_SERVER["SCRIPT_URL"]); #print $thisDir;
|
||||
|
||||
$cnt = 0;
|
||||
|
||||
$files = array_merge(loadDirSimple("./",".*","f"), loadDirSimple("./",".*","d"));
|
||||
if (sizeof($files)>0) { ?>
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<head>
|
||||
<title>CDT 9.4.0 stand-alone RCP debugger</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$downloadPrefix = "https://www.eclipse.org/downloads/download.php?file=";
|
||||
$downloadDotEclipseServer = preg_match("#download.eclipse.org#",$_SERVER["DOCUMENT_ROOT"]) || preg_match("#download.eclipse.org#",$_SERVER["SERVER_NAME"]) || preg_match("#download.eclipse.org#",$_SERVER["SCRIPT_URI"]);
|
||||
|
||||
echo "<table>\n";
|
||||
echo "<tr class=\"h\"><td colspan=\"3\"><h1 class=\"p\">CDT 9.4.0 stand-alone RCP debugger</h1></td></tr>";
|
||||
sort($files);
|
||||
foreach ($files as $file) {
|
||||
$cnt++;
|
||||
if ($file != ".htaccess" && false===strpos($file,"index.") && $file != "CVS")
|
||||
{
|
||||
if (is_file($file))
|
||||
{
|
||||
$downloadSize = filesize("$file");
|
||||
echo '<tr><td> • <a href="' . ($downloadDotEclipseServer ? $downloadPrefix . $thisDir : '') . $file . '">' . $file. '</a> (' . pretty_size($downloadSize) . ')</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<tr><td> • <a href="' . $file . '">' . $file. '</a></td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
} else {
|
||||
echo "No files found!";
|
||||
}
|
||||
print "<p> </p>";
|
||||
|
||||
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]);
|
||||
}
|
||||
?>
|
74
releng/scripts/promote-a-build.sh
Normal file
74
releng/scripts/promote-a-build.sh
Normal file
|
@ -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
|
24
releng/scripts/promote-files-to-download.sh
Normal file
24
releng/scripts/promote-files-to-download.sh
Normal file
|
@ -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/"
|
Loading…
Add table
Reference in a new issue