Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions JenkinsJobs/Builds/FOLDER.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,26 @@ pipelineJob('Builds/Build-Docker-images'){
}
}
}

pipelineJob('Builds/mark-build'){
displayName("Mark build")
description("Mark a build as stable or unstable.")
parameters {
stringParam('buildId', null, "ID of the build to be marked.")
choiceParam('markAs', [
'STABLE',
'UNSTABLE',
], 'The kind of marker to apply to (respectively remove from) the specified build.')
stringParam('issueURL', null, 'URL of the causing Github issue or PR (<em>only relevant if the build is marked as unstable<em>).')
}

definition {
cpsScm {
lightweight(true)
scm {
github('eclipse-platform/eclipse.platform.releng.aggregator', 'master')
}
scriptPath('JenkinsJobs/Builds/markBuild.jenkinsfile')
}
}
}
88 changes: 0 additions & 88 deletions JenkinsJobs/Builds/markBuild.groovy

This file was deleted.

63 changes: 63 additions & 0 deletions JenkinsJobs/Builds/markBuild.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
pipeline {
options {
skipDefaultCheckout()
timestamps()
timeout(time: 5, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'5'))
}
agent {
label 'basic'
}
stages {
stage('Mark build'){
environment {
// Download Server locations (would very seldom change)
EP_BUILD_DROP = "/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4/${buildId}"
RELEASE_VER = readBuildProperty('RELEASE_VER')
}
steps {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh '''#!/bin/bash -xe
# Strip spaces from the buildId and eclipseStream
buildId=$(echo $buildId|tr -d ' ')
issueURL=$(echo $issueURL|tr -d ' ')

if [ -z "$buildId" ]; then
echo "BuildId is empty! Exiting."
exit 1
fi
if [ "$markAs" == 'UNSTABLE' ] && [ -z "$issueURL" ]; then
echo "Required issueURL parameter is empty! Exiting."
exit 1
fi

case ${markAs} in
STABLE)
#Remove unstable tag
ssh [email protected] rm -f ${EP_BUILD_DROP}/buildUnstable
;;
UNSTABLE)
# Convert URL of GH issue or PR into: 'organization/repository#number'
label=$(echo "${issueURL##'https://github.com/'}" | sed 's/\\/issues\\//#/g' | sed 's/\\/pull\\//#/g')
#Add unstable tag
echo "<p>This build is marked unstable due to <a href='${issueURL}'>${label}</a>.</p>" > buildUnstable
scp buildUnstable [email protected]:${EP_BUILD_DROP}/buildUnstable
;;
esac
'''
}
build job: 'Releng/updateIndex', wait: false
build job: 'Releng/modifyP2CompositeRepository', wait: true, propagate: true, parameters: [
string(name: 'repositoryPath', value: "eclipse/updates/${RELEASE_VER}-I-builds"),
string(name: "${params.markAs == 'STABLE' ? 'add' : 'remove'}", value: "${buildId}")
]
}
}
}
}

def readBuildProperty(String name) {
def buildPropertiesURL = "https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.properties"
def buildProperties = readProperties(text: sh(script: "curl --fail ${buildPropertiesURL}", returnStdout: true))
return buildProperties[name].replace('"','') // Remove surrounding quotes
}
Loading