Commit d7835e50 authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Merge branch 'SPI-1891' into 'LCG_100-patches'

Add RPM revision as parameter in Jenkins
parents b3c8f59b 76b60db2
Pipeline #2626879 passed with stage
in 37 seconds
......@@ -69,7 +69,8 @@ def install_tarfile(urltarfile, prefix, lcgprefix, with_hash=True, with_link=Tru
if os.path.exists(postinstall) :
#---Replace the old post-install script with new one
with open(postinstall) as f:
if '#!/bin/sh' in f.read():
script = f.read()
if '#!/bin/sh' in script or 'RPM_INSTALL_PREFIX' not in script:
f.close()
shutil.copy(os.path.join(os.path.dirname(os.path.realpath(__file__)),'post-install.sh'), postinstall)
os.environ['INSTALLDIR'] = prefix
......
......@@ -39,6 +39,7 @@ pipeline {
choice(name: 'RPM_DRYRUN', choices: ['no', 'yes'], description: 'RPMs publish dryrun')
booleanParam(name: 'RPM_TEST', defaultValue: false, description: 'RPMs tests')
string(name: 'RPM_REPOSITORY', defaultValue: '', description: 'RPM repository e.g /eos/project/l/lcg/www/lcgpackages/lcg/repo/7/LCG_97/ or empty')
string(name: 'RPM_REVISION_NUMBER', defaultValue: '', description: 'RPM revision number (default is the LCG numeric version)')
}
//---Options----------------------------------------------------------------------------------------------------------
options {
......
......@@ -24,6 +24,11 @@ def buildPackages() {
ctest -VV -DCTEST_LABELS=Release -S lcgcmake/jenkins/lcgcmake-build.cmake
"""
}
//---Fail the release if the build stage fails-------------------------------------------------------------------------
if ( params.BUILDMODE == 'release' && currentBuild.result == 'UNSTABLE') {
echo 'Setting the build state to FAILURE for BUILDMODE equal to release'
currentBuild.result = 'FAILURE'
}
//---Update a number of variables after the build step-----------------------------------------------------------------
PLATFORM = sh(returnStdout: true, script: 'lcgcmake/jenkins/getPlatform.py').trim()
barePLATFORM = ([PLATFORM.split('-')[0].split('\\+')[0]]+PLATFORM.split('-')[1..3]).join('-').replace('gcc7','gcc8').replace('dbg','opt')
......@@ -181,6 +186,7 @@ def testPythonImport() {
def createRPMS() {
sh label: 'create-rpms', script: """
cd ${WORKSPACE}/install
export RPM_REVISION_NUMBER=${RPM_REVISION_NUMBER}
${WORKSPACE}/lcgcmake/jenkins/package_release.py ${WORKSPACE} ${LCG_VERSION} ${PLATFORM} ${TARGET} ${BUILDMODE} ${COMPILER}
"""
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment