Skip to content

Commit b4951ee

Browse files
committed
In Jenkinsfile_EL9 pipeline replace rpmbuild stage with DEbuild and use make-release.sh script to build DE/DEM RPMs/wheels
1 parent ac9e238 commit b4951ee

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.Jenkins/workflows/Jenkinsfile_EL9

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ pipeline {
181181
}
182182
}
183183
}
184-
stage('rpmbuild') {
184+
stage('DEbuild') {
185185
agent {
186186
node {
187187
label 'podman'
@@ -194,7 +194,7 @@ pipeline {
194194
steps {
195195
script {
196196
// DOCKER_IMAGE is defined through Jenkins project
197-
rpmbuildStageDockerImage="localhost/${DOCKER_IMAGE}_${BUILD_NUMBER}_${STAGE_NAME}"
197+
DEbuildStageDockerImage="localhost/${DOCKER_IMAGE}_${BUILD_NUMBER}_${STAGE_NAME}"
198198
}
199199
echo "cleanup workspace"
200200
sh 'for f in $(ls -A); do rm -rf ${f}; done'
@@ -212,14 +212,27 @@ pipeline {
212212
fi
213213
cd ..
214214
'''
215-
echo "prepare podman image ${rpmbuildStageDockerImage}"
216-
sh "podman build --pull --tag ${rpmbuildStageDockerImage} --build-arg BASEIMAGE=docker.io/hepcloud/decision-engine-ci-el9:${BRANCH} --build-arg UID=\$(id -u) --build-arg GID=\$(id -g) -f decisionengine/package/ci/EL9/Dockerfile decisionengine/package/ci/EL9/"
215+
echo "clone decisionengine_modules code from ${DEM_REPO}"
216+
sh '''
217+
git clone ${DEM_REPO}
218+
cd decisionengine_modules
219+
echo "checkout ${BRANCH} branch"
220+
git checkout ${BRANCH}
221+
echo GITHUB_PR_NUMBER: ${GITHUB_PR_NUMBER} - GITHUB_PR_STATE: ${GITHUB_PR_STATE}
222+
if [[ -n ${GITHUB_PR_NUMBER} && ${GITHUB_PR_STATE} == OPEN ]]; then
223+
git fetch origin pull/${GITHUB_PR_NUMBER}/merge:merge${GITHUB_PR_NUMBER}
224+
git checkout merge${GITHUB_PR_NUMBER}
225+
fi
226+
cd ..
227+
'''
228+
echo "prepare podman image ${DEbuildStageDockerImage}"
229+
sh "podman build --pull --tag ${DEbuildStageDockerImage} --build-arg BASEIMAGE=docker.io/hepcloud/decision-engine-ci-el9:${BRANCH} --build-arg UID=\$(id -u) --build-arg GID=\$(id -g) -f decisionengine/package/ci/EL9/Dockerfile decisionengine/package/ci/EL9/"
217230
echo "Run ${STAGE_NAME} tests"
218-
sh "podman run --userns keep-id:uid=\$(id -u),gid=\$(id -g) --rm --env PYTEST_TIMEOUT=${PYTEST_TIMEOUT} -v ${WORKSPACE}/decisionengine:${WORKSPACE}/decisionengine -w ${WORKSPACE}/decisionengine ${rpmbuildStageDockerImage} \"setup.py bdist_rpm\" \"rpmbuild.log\""
231+
sh "podman run --privileged --userns keep-id:uid=\$(id -u),gid=\$(id -g) --rm --env PYTEST_TIMEOUT=${PYTEST_TIMEOUT} -v ${WORKSPACE}:${WORKSPACE} -w ${WORKSPACE} --entrypoint /bin/bash ${DEbuildStageDockerImage} \"decisionengine/package/release/make-release.sh\" \"-v\" \"-e\" \"${BRANCH}\""
219232
}
220233
post {
221234
always {
222-
archiveArtifacts artifacts: "decisionengine/rpmbuild.log,decisionengine/dist/*.rpm"
235+
archiveArtifacts artifacts: "dist/decisionengine*,rpmbuild/RPMS/decisionengine*"
223236
// check if the podman container used for this test suite is still active, if so this is due to an aborted test suite
224237
// eventually kill the python process that spawn the test to cleanup CI processes left behind
225238
sh '''
@@ -231,8 +244,8 @@ pipeline {
231244
podman exec ${PODMANID} ps -xww || true
232245
fi
233246
'''
234-
echo "cleanup podman image ${rpmbuildStageDockerImage}"
235-
sh "podman rmi ${rpmbuildStageDockerImage}"
247+
echo "cleanup podman image ${DEbuildStageDockerImage}"
248+
sh "podman rmi ${DEbuildStageDockerImage}"
236249
}
237250
}
238251
}

0 commit comments

Comments
 (0)