139 lines
4.7 KiB
Text
139 lines
4.7 KiB
Text
pipeline {
|
|
agent { label "${AGENT_LABEL}" }
|
|
stages {
|
|
stage('Initial setup') {
|
|
steps {
|
|
script {
|
|
configurationhelper = load("${WORKSPACE}/Common_scripts/configuration/configuration.gsh")
|
|
githelper = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh")
|
|
echo "Uncomment me"
|
|
//configurationhelper.registerPipelineScriptConfiguration()
|
|
}
|
|
}
|
|
}
|
|
stage('Clean workspace') {
|
|
when {
|
|
expression {
|
|
env.CLEAN_WORKSPACE == "true"
|
|
}
|
|
}
|
|
steps {
|
|
// Save any script files that were loaded into the workspace at first and are required after cleaning the workspace
|
|
stash allowEmpty: true, includes: 'Common_scripts/**/*', name: 'Clean workspace stash', useDefaultExcludes: false
|
|
cleanWs()
|
|
unstash name: 'Clean workspace stash'
|
|
}
|
|
}
|
|
stage('Nothing to build check') {
|
|
// Need to work out what this does: FIXME
|
|
when {
|
|
expression {
|
|
env.RELEASE_COMMIT == "false"
|
|
}
|
|
}
|
|
steps {
|
|
echo 'No installers to build'
|
|
script {
|
|
currentBuild.result = 'UNSTABLE'
|
|
}
|
|
}
|
|
}
|
|
stage('Checkout dependencies') {
|
|
when {
|
|
expression {
|
|
env.RELEASE_COMMIT == "true"
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
PYTHONURL = 'git@hydra:tools/python.git'
|
|
PYTHONBRANCH = 'origin/3.6.3_windows'
|
|
PYTHONDIR = "${WORKSPACE}/python"
|
|
PYTHONROOTDIR = 'python'
|
|
configurationhelper.gitCheckoutAndRegister('python', PYTHONURL, PYTHONBRANCH, PYTHONDIR, PYTHONROOTDIR)
|
|
env.PYTHON = "${PYTHONDIR}/ver/python.exe"
|
|
|
|
}
|
|
}
|
|
}
|
|
stage("Clean imports") {
|
|
steps {
|
|
script {
|
|
env.IMPORTSPATH = "${WORKSPACE}/imports"
|
|
}
|
|
dir("${IMPORTSPATH}") {
|
|
echo "Deleting directories in ${IMPORTSPATH}"
|
|
deleteDir()
|
|
}
|
|
}
|
|
}
|
|
stage("Import binaries and versions") {
|
|
when {
|
|
expression {
|
|
env.RELEASE_COMMIT == "true"
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
projectImports = [
|
|
[ 'Embedded Logic and Version', "${SYNTH_ARTIFACTS_JOB}", "${IMPORTSPATH}/build", '**', false ],
|
|
]
|
|
for (projectImport in projectImports) {
|
|
(importName, sourceProject, destFolder, toCopy, checkImports) = projectImport
|
|
copyArtifacts excludes: '', filter: toCopy, fingerprintArtifacts: true, projectName: "${sourceProject}", selector: specific("${SYNTH_ARTIFACTS_BUILD_SELECTOR}"), target: "${destFolder}"
|
|
// change lastSuccessful to allow a user to pick
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage("Release to git") {
|
|
when {
|
|
expression {
|
|
env.RELEASE_COMMIT == "true"
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
bat '''
|
|
"%PYTHON34%" -u "%WORKSPACE%\\release_to_git\\conditional_add.py"
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Check for unstable build') {
|
|
when {
|
|
expression {
|
|
env.RELEASE_COMMIT == "true"
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
if (env.DRY_RUN_PUSH == "true") {
|
|
echo "Not pushing the content to git therefore marking building unstable"
|
|
currentBuild.result = 'UNSTABLE'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
echo 'Post-build'
|
|
}
|
|
failure {
|
|
echo 'Failed build'
|
|
/*
|
|
step([$class: 'LogParserPublisher',
|
|
parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt',
|
|
useProjectRule: true
|
|
])
|
|
*/
|
|
}
|
|
unstable {
|
|
echo 'Unstable build'
|
|
}
|
|
success {
|
|
echo 'Succeeded build'
|
|
}
|
|
}
|
|
}
|