Skip to content

Commit

Permalink
Build in CI with conan v2
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Jul 25, 2024
1 parent 900f6ef commit ebe1573
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pipeline {
agent { label 'sds-builder-2204' }
agent { label 'sds-builder-v5' }

environment {
ARTIFACTORY_PASS = credentials('ARTIFACTORY_PASS')
Expand All @@ -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 = ""
}
}
}
Expand All @@ -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."
}
}
Expand All @@ -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} . ; \
"
}
}

Expand All @@ -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"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ebe1573

Please sign in to comment.