From ebe15738c4bd2b4724b7b86a77ce97fd7cf179ec Mon Sep 17 00:00:00 2001 From: Brian Szmyd Date: Thu, 25 Jul 2024 15:12:35 -0700 Subject: [PATCH] Build in CI with conan v2 --- .jenkins/Jenkinsfile | 29 ++++++++++++++++------------- conanfile.py | 4 ++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 69a8ddf..081ea00 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') @@ -15,14 +15,17 @@ pipeline { } } 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,13 +54,11 @@ pipeline { stage("Compile") { steps { - sh "sed -i 's,nuraft/2.1.0,nuraft/nbi.2.1.1,' conanfile.py" - sh "sed -i 's,openssl/1.1.1q,openssl/1.1.1s,' conanfile.py" - sh "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 sisl:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \ - conan create ${BUILD_MISSING} -pr test -o sisl:prerelease=True -o sisl: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 sisl/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \ + conan create ${BUILD_MISSING} -s:h build_type=RelWithDebInfo -o sisl/*:prerelease=True -o sisl/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \ + " } } @@ -65,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} -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" } } } diff --git a/conanfile.py b/conanfile.py index 1ff9721..7794869 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,7 +10,7 @@ class NuRaftMesgConan(ConanFile): name = "nuraft_mesg" - version = "3.5.6" + version = "3.5.7" homepage = "https://github.com/eBay/nuraft_mesg" description = "A gRPC service for NuRAFT" @@ -66,7 +66,7 @@ def build_requirements(self): def requirements(self): self.requires("boost/1.83.0", transitive_headers=True) - self.requires("sisl/[~12.2, include_prerelease=True]@oss/master", transitive_headers=True) + self.requires("sisl/[^12.2]@oss/master", transitive_headers=True) self.requires("nuraft/2.4.0", transitive_headers=True) def layout(self):