HMBXR5601-395 First import from Printserver2_Autobuild_Scripts
This commit is contained in:
parent
233c3dffd1
commit
6324800b82
1 changed files with 150 additions and 0 deletions
150
release_to_git/release_to_git.gsh
Normal file
150
release_to_git/release_to_git.gsh
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
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') {
|
||||
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"
|
||||
|
||||
SOURCEURL = 'git@hydra:gis/newsw.git'
|
||||
SOURCEBRANCH = "${SOURCE_BRANCH}"
|
||||
SOURCEDIR = "${WORKSPACE}\\newsw"
|
||||
SOURCEROOTDIR = 'newsw'
|
||||
configurationhelper.gitCheckoutAndRegister('newsw', SOURCEURL, SOURCEBRANCH, SOURCEDIR, SOURCEROOTDIR)
|
||||
env.SOURCE_PATH = "${SOURCEDIR}"
|
||||
}
|
||||
}
|
||||
}
|
||||
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 = [
|
||||
[ 'Installers and Binaries', "${INSTALLER_BUILD_JOB}", "${IMPORTSPATH}/install", '**', true ],
|
||||
[ 'Build', "${BUILD_JOB}", "${IMPORTSPATH}/build", 'version/**,pipeline/**', false ],
|
||||
]
|
||||
for (projectImport in projectImports) {
|
||||
(importName, sourceProject, destFolder, toCopy, checkImports) = projectImport
|
||||
copyArtifacts excludes: '', filter: toCopy, fingerprintArtifacts: true, projectName: "${sourceProject}", selector: lastSuccessful(), target: "${destFolder}"
|
||||
if (checkImports) {
|
||||
env.importDest = destFolder
|
||||
bat '''
|
||||
"%PYTHON%" "%SOURCE_PATH%\\autobuild\\common\\fingerprint.py" -f "%importDest%\\pipeline\\hashes.txt" -v -p "%importDest%"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Release to git") {
|
||||
when {
|
||||
expression {
|
||||
env.RELEASE_COMMIT == "true"
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
bat '''
|
||||
"%PYTHON34%" -u "%WORKSPACE%\\newsw\\autobuild\\releasetogit\\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'
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue