In Jenkins add url to github repo, remove publishTestStabilityData from devbranch junit reports, and add the formatChanges function.
In jenkinscommand.sh add debug when container exits unsuccessfully.
diff --git a/docker/jenkins/jenkinscommand.sh b/docker/jenkins/jenkinscommand.sh
index caa97e2..ea6d764 100644
--- a/docker/jenkins/jenkinscommand.sh
+++ b/docker/jenkins/jenkinscommand.sh
@@ -23,14 +23,23 @@
echo "$ID done (${status}), copying files"
if [ "$status" -ne 0 ] ; then
+ echo "$ID failed (${status}), debug…"
+ docker inspect $ID
+ echo "–––"
+ docker logs $ID
+ echo "–––"
docker ps -a
+ echo "–––"
docker info
+ echo "–––"
+ dmesg
+else
+ echo "$ID done (${status}), copying files"
+ # pytest results
+ docker cp $ID:/home/cassandra/cassandra/cassandra-dtest/nosetests.xml .
+ # pytest logs
+ docker cp $ID:/home/cassandra/cassandra/test_stdout.txt .
+ docker cp $ID:/home/cassandra/cassandra/cassandra-dtest/ccm_logs.tar.xz .
fi
-# pytest results
-docker cp $ID:/home/cassandra/cassandra/cassandra-dtest/nosetests.xml .
-# pytest logs
-docker cp $ID:/home/cassandra/cassandra/test_stdout.txt .
-docker cp $ID:/home/cassandra/cassandra/cassandra-dtest/ccm_logs.tar.xz .
-
docker rm $ID
diff --git a/jenkins-dsl/cassandra_job_dsl_seed.groovy b/jenkins-dsl/cassandra_job_dsl_seed.groovy
index f006dae..7315c59 100644
--- a/jenkins-dsl/cassandra_job_dsl_seed.groovy
+++ b/jenkins-dsl/cassandra_job_dsl_seed.groovy
@@ -22,8 +22,11 @@
largeSlaveLabel = "${CASSANDRA_LARGE_SLAVE_LABEL}"
}
def mainRepo = "https://gitbox.apache.org/repos/asf/cassandra.git"
+def githubRepo = "https://github.com/apache/cassandra.git"
if(binding.hasVariable("CASSANDRA_GIT_URL")) {
mainRepo = "${CASSANDRA_GIT_URL}"
+ // just presume custom repos are github, not critical if they are not
+ githubRepo = "${mainRepo}"
}
def buildsRepo = "https://gitbox.apache.org/repos/asf/cassandra-builds.git"
if(binding.hasVariable("CASSANDRA_BUILDS_GIT_URL")) {
@@ -79,7 +82,7 @@
label(slaveLabel)
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -88,6 +91,9 @@
}
timestamps()
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -154,7 +160,7 @@
label(slaveLabel)
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -166,6 +172,9 @@
throttleConcurrentBuilds {
categories(['Cassandra'])
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -217,7 +226,7 @@
label(slaveLabel)
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -226,6 +235,9 @@
}
timestamps()
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -274,7 +286,7 @@
concurrentBuild()
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -293,6 +305,9 @@
}
// this should prevent long path expansion from the axis definitions
childCustomWorkspace('.')
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -481,7 +496,7 @@
label(slaveLabel)
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -494,6 +509,9 @@
stringParam('REPO', 'apache', 'The github user/org to clone cassandra repo from')
stringParam('BRANCH', 'trunk', 'The branch of cassandra to checkout')
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -537,7 +555,7 @@
label(slaveLabel)
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -553,6 +571,9 @@
stringParam('REPO', 'apache', 'The github user/org to clone cassandra repo from')
stringParam('BRANCH', 'trunk', 'The branch of cassandra to checkout')
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -575,11 +596,7 @@
allowEmpty()
fingerprint()
}
- archiveJunit('build/test/**/TEST-*.xml') {
- testDataPublishers {
- publishTestStabilityData()
- }
- }
+ archiveJunit('build/test/**/TEST-*.xml')
postBuildTask {
task('.', '''
echo "Finding job process orphans…"; if pgrep -af ${JOB_BASE_NAME}; then pkill -9 -f ${JOB_BASE_NAME}; fi;
@@ -615,7 +632,7 @@
}
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -631,6 +648,9 @@
stringParam('DTEST_BRANCH', 'master', 'The branch of cassandra-dtest to checkout')
stringParam('DOCKER_IMAGE', "${dtestDockerImage}", 'Docker image for running dtests')
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -653,11 +673,7 @@
allowEmpty()
fingerprint()
}
- archiveJunit('nosetests.xml') {
- testDataPublishers {
- publishTestStabilityData()
- }
- }
+ archiveJunit('nosetests.xml')
postBuildTask {
task('.', '''
echo "Cleaning project…" ; git clean -xdff ;
@@ -681,7 +697,7 @@
concurrentBuild()
compressBuildLog()
logRotator {
- numToKeep(30)
+ numToKeep(10)
artifactNumToKeep(10)
}
wrappers {
@@ -706,6 +722,9 @@
}
// this should prevent long path expansion from the axis definitions
childCustomWorkspace('.')
+ properties {
+ githubProjectUrl(githubRepo)
+ }
scm {
git {
remote {
@@ -728,11 +747,7 @@
allowEmpty()
fingerprint()
}
- archiveJunit('**/cqlshlib.xml,**/nosetests.xml') {
- testDataPublishers {
- publishTestStabilityData()
- }
- }
+ archiveJunit('**/cqlshlib.xml,**/nosetests.xml')
postBuildTask {
task('.', '''
echo "Finding job process orphans…"; if pgrep -af ${JOB_BASE_NAME}; then pkill -9 -f ${JOB_BASE_NAME}; fi;
@@ -765,6 +780,9 @@
stringParam('DTEST_BRANCH', 'master', 'The branch of cassandra-dtest to checkout')
stringParam('DOCKER_IMAGE', "${dtestDockerImage}", 'Docker image for running dtests')
}
+ properties {
+ githubProjectUrl(githubRepo)
+ }
definition {
cps {
// Cassandra-devbranch still needs custom Jenkinsfile because of the parameters passed into the build jobs.
diff --git a/jenkins-dsl/cassandra_pipeline.groovy b/jenkins-dsl/cassandra_pipeline.groovy
index 15de1ce..e902eaa 100644
--- a/jenkins-dsl/cassandra_pipeline.groovy
+++ b/jenkins-dsl/cassandra_pipeline.groovy
@@ -238,6 +238,11 @@
sh "git clone https://gitbox.apache.org/repos/asf/cassandra-builds.git"
sh "./cassandra-builds/build-scripts/cassandra-test-report.sh"
junit '**/build/test/**/TEST*.xml,**/cqlshlib.xml,**/nosetests.xml'
+ script {
+ // though this is not used in the devbranch pipeline, it exists here for testing the in-tree Jenkinsfile
+ changes = formatChanges(currentBuild.changeSets)
+ echo "changes: ${changes}"
+ }
}
post {
always {
@@ -257,3 +262,14 @@
target: target]);
}
+def formatChanges(changeLogSets) {
+ def result = ''
+ for (int i = 0; i < changeLogSets.size(); i++) {
+ def entries = changeLogSets[i].items
+ for (int j = 0; j < entries.length; j++) {
+ def entry = entries[j]
+ result = result + "${entry.commitId} by ${entry.author} on ${new Date(entry.timestamp)}: ${entry.msg}\n"
+ }
+ }
+ return result
+}