diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 51d3d78b..d9dfffdf 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { label 'sds-builder-2204' } + agent { label 'sds-builder-v5' } environment { ARTIFACTORY_PASS = credentials('ARTIFACTORY_PASS') @@ -9,20 +9,23 @@ pipeline { } stages { - stage('Adjust Tag for Master/PR') { + stage('Adjust for Master/PR') { when { not { branch "${STABLE_BRANCH}" } } steps { script { - sh(script: "sed -Ei 's, version = .*\"([[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+).*, version = \"\\1-${env.BUILD_NUMBER}\",' conanfile.py") + BUILD_MISSING = "--build missing" } } } - stage('include build missing') { + stage('Adjust for Testing/Stable') { + when { + branch "${STABLE_BRANCH}" + } steps { script { - BUILD_MISSING = "--build missing" + BUILD_MISSING = "" } } } @@ -34,6 +37,7 @@ pipeline { VER = sh(script: "grep -m 1 ' version =' conanfile.py | awk '{print \$3}' | tr -d '\n' | tr -d '\"'", returnStdout: true) CONAN_CHANNEL = sh(script: "echo ${BRANCH_NAME} | sed -E 's,(\\w+-?\\d*)/.*,\\1,' | sed -E 's,-,_,' | tr -d '\n'", returnStdout: true) TAG = "${VER}@${CONAN_USER}/${CONAN_CHANNEL}" + CONAN_FLAGS="--name ${PROJECT} --user ${CONAN_USER} --channel ${CONAN_CHANNEL}" slackSend color: '#0063D1', channel: '#sds-ci', message: "*${PROJECT}/${TAG}* is building." } } @@ -50,11 +54,10 @@ pipeline { stage("Compile") { steps { - sh "conan export 3rd_party/folly folly/nu2.2023.12.11.00@ ; \ - conan create ${BUILD_MISSING} -pr debug -o ${PROJECT}:sanitize=True . ${PROJECT}/${TAG} ; \ - conan create ${BUILD_MISSING} -pr debug . ${PROJECT}/${TAG} ; \ - conan create ${BUILD_MISSING} -pr test -o ${PROJECT}:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \ - conan create ${BUILD_MISSING} -pr test -o ${PROJECT}:prerelease=True -o ${PROJECT}:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \ + sh "conan create ${BUILD_MISSING} -s:h build_type=Debug -o ${PROJECT}/*:sanitize=True ${CONAN_FLAGS} . ; \ + conan create ${BUILD_MISSING} -s:h build_type=Debug ${CONAN_FLAGS} . ; \ + conan create ${BUILD_MISSING} -s:h build_type=RelWithDebInfo -o ${PROJECT}/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \ + conan create ${BUILD_MISSING} -s:h build_type=RelWithDebInfo -o ${PROJECT}/*:prerelease=True -o ${PROJECT}/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \ " } } @@ -64,8 +67,9 @@ pipeline { expression { !(env.BRANCH_NAME =~ /PR-/) } } steps { - sh "conan user -r ebay-local -p ${ARTIFACTORY_PASS} _service_sds" - sh "conan upload ${PROJECT}/${TAG} --parallel -c --all -r ebay-local" + sh "conan remote login -p ${ARTIFACTORY_PASS} ebay-local _service_sds" + sh "conan graph info ./ | grep 'ref: ' | awk '{print \$2}' | sort | uniq | grep -v ${PROJECT} | grep -v '#' | while read pkg; do conan upload -r ebay-local -c \"\${pkg}\"; done" + sh "conan upload ${PROJECT}/${TAG} -c -r ebay-local" } } }