Module: check_mk
Branch: master
Commit: e601df31fcb9f861e9ee05f3231abfc25ecc8634
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e601df31fcb9f8…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Wed Apr 17 13:45:08 2019 +0200
Add packaging tests to nightly build and testbuild
Change-Id: I85b95ece50c651508756548130b7bce55206fa3f
---
buildscripts/scripts/nightly-build.jenkins | 52 ++++++++++++++++++++----------
1 file changed, 35 insertions(+), 17 deletions(-)
diff --git a/buildscripts/scripts/nightly-build.jenkins
b/buildscripts/scripts/nightly-build.jenkins
index 9d754ed..7ac8f9e 100644
--- a/buildscripts/scripts/nightly-build.jenkins
+++ b/buildscripts/scripts/nightly-build.jenkins
@@ -28,12 +28,21 @@ def DOCKER_BUILDS = [:]
def dateFormat = new SimpleDateFormat("yyyy.MM.dd")
def date = new Date()
def CMK_VERS = dateFormat.format(date)
-def DAILY_DATA = '/var/jenkins_home/daily-data/' +
scm.branches[0].name.replaceAll("/","-") + '/' + CMK_VERS
+def DAILY_DATA = ''
def PACKAGE_DIR = '/bauwelt/download'
def GPG_KEY_DIR = '/bauwelt/etc/.gnupg'
def RELEASE_KEY_DIR = '/bauwelt/git/release/release.key'
+def ARCHIVE_DIR = ''
+if (scm.branches[0].name == 'master' && JOB_BASE_NAME ==
'nightly_build_containerized') {
+ DAILY_DATA = '/var/jenkins_home/daily-data/' +
scm.branches[0].name.replaceAll("/","-") + '/' + CMK_VERS
+ ARCHIVE_DIR = '/bauwelt/download/' + CMK_VERS
+} else {
+ DAILY_DATA = '/var/jenkins_home/daily-data/testbuild/' +
scm.branches[0].name.replaceAll("/","-") + '/' + CMK_VERS
+ ARCHIVE_DIR = DAILY_DATA + '/download'
+}
+
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
@@ -236,36 +245,45 @@ node {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside("-u 0:0 -v ${DAILY_DATA}:${DAILY_DATA} -v
${PACKAGE_DIR}:${PACKAGE_DIR} -v ${GPG_KEY_DIR}:${GPG_KEY_DIR}:ro -v
${RELEASE_KEY_DIR}:${RELEASE_KEY_DIR}:ro --network ci_local-infra") {
- stage('Archive artifacts') {
- // Only master builds should end up on the Website
- if (scm.branches[0].name == 'master' && JOB_BASE_NAME ==
'nightly_build_containerized') {
+ stage('Sign artifacts') {
sh """
- mkdir -p /bauwelt/download/${CMK_VERS}
- cd /bauwelt/download/${CMK_VERS}
+ mkdir -p ${ARCHIVE_DIR}
+ cd ${ARCHIVE_DIR}
cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*_amd64.deb . ||
true
cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*.x86_64.rpm . ||
true
cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*x86_64.cma . ||
true
cp ${DAILY_DATA}/git/check-mk-${EDITION}-${CMK_VERS}.cee.tar.gz .
|| true
"""
withCredentials([usernamePassword(credentialsId:
'9d7aca31-0043-4cd0-abeb-26a249d68261', passwordVariable:
'GPG_PASSPHRASE', usernameVariable: 'GPG_USERNAME')]) {
+ sh """
+ cd ${ARCHIVE_DIR}
+ ${DAILY_DATA}/git/buildscripts/scripts/sign-packages.sh
${CMK_VERS}
+ """
+ }
+ stage('Packaging Tests') {
+ try {
+ dir("${DAILY_DATA}/git/tests") {
+ withEnv(["VERSION_PATH=i${ARCHIVE_DIR}",
"PYTEST_ADDOPTS='--junitxml=\"${WORKSPACE}/junit.xml\"'"]) {
+ sh ". /bauwelt/bin/bw-setup-jenkins-env ; make
test-packaging"
+ }
+ }
+ } finally {
+ step([$class: 'JUnitResultArchiver', testResults:
'junit.xml'])
+ }
+ }
+ stage('Archive Artifacts') {
+ // Only master builds should end up on the Website
+ if (scm.branches[0].name == 'master' && JOB_BASE_NAME ==
'nightly_build_containerized') {
sh """
- cd /bauwelt/download/${CMK_VERS}
- ${DAILY_DATA}/git/buildscripts/scripts/sign-packages.sh
${CMK_VERS}
+ cd ${ARCHIVE_DIR}
rsync -av -e "ssh -o StrictHostKeyChecking=no -i
${RELEASE_KEY_DIR}" \
${PACKAGE_DIR}/${CMK_VERS} \
bauwelt@mathias-kettner.de:${PACKAGE_DIR}
"""
- }
} else {
- dir("${DAILY_DATA}/download") {
- sh "cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*_amd64.deb
. || true"
- sh "cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*.x86_64.rpm
. || true"
- sh "cp ${DAILY_DATA}/*-dest/check-mk-${EDITION}-*x86_64.cma
. || true"
- sh "cp
${DAILY_DATA}/git/check-mk-${EDITION}-${CMK_VERS}.*.tar.gz . || true"
- withCredentials([usernamePassword(credentialsId:
'9d7aca31-0043-4cd0-abeb-26a249d68261', passwordVariable:
'GPG_PASSPHRASE', usernameVariable: 'GPG_USERNAME')]) {
- sh
"${DAILY_DATA}/git/buildscripts/scripts/sign-packages.sh ${CMK_VERS}"
+ dir(ARCHIVE_DIR) {
+ archiveArtifacts "*"
}
- archiveArtifacts "*"
}
}
}