Commit d146c19d authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'stash' into 'master'

Use stash for blessed builds too

Closes #62

See merge request Librem5/deb-build-jobs!223
parents 5636ad30 9ef6689e
......@@ -50,6 +50,7 @@ Yaml yaml = new Yaml()
def jobsfile = (new File(__FILE__)).parent + '/jobs.yml'
println("Using jobsfile : ${jobsfile}")
def pkgs = yaml.load(new File(jobsfile).text)
def uploads = '*.deb *.tar.* *.diff.* *.dsc *.changes *.buildinfo'
pkgs.each { pkg ->
params = pkg.value
......@@ -145,6 +146,7 @@ pkgs.each { pkg ->
""".stripIndent()
node_label = "${os}-${arch}"
stash = "${os}-${pkg.key}-${arch}"
pipelineJob(name) {
......@@ -164,8 +166,7 @@ pkgs.each { pkg ->
]
try {
def test_result = ""
def linitan_result = ""
def lintian_result = ""
def head_tag = ""
stage('Build Debian Package') {
......@@ -182,6 +183,7 @@ pkgs.each { pkg ->
])
def result = sh returnStatus: true, script: '''${build_cmd}'''
stash name: '${stash}', allowEmpty: false, includes: "${uploads.replaceAll(' ',',')}"
if(result != 0) {
if(result == 128) {
......@@ -210,16 +212,20 @@ pkgs.each { pkg ->
stage('Save Artifacts') {
node ('${node_label}') {
unstash '${stash}'
archiveArtifacts '${artifacts}'
}
}
stage('Upload Debian Packages') {
node ('${node_label}') {
unstash '${stash}'
def result = sh returnStatus: true, script: '''${upload_cmd}'''
if(result != 0) {
if (result == 64) {
linitan_result = 'lintian failed'
lintian_result = 'lintian failed'
print "Lintian check of package failed."
} else if (result == 32) {
currentBuild.result = 'FAILURE'
......@@ -241,22 +247,6 @@ pkgs.each { pkg ->
}
}
stage('Test Package') {
node ('${node_label}') {
if(currentBuild.result == 'UNSTABLE' || currentBuild.result == 'SUCCESS') {
sh '[ -d "/tmp/$pkg.key" ] || mkdir "/tmp/$pkg.key"'
def result = sh returnStatus: true, script: 'sudo /usr/local/bin/docker_run_test.sh "$pkg.key" "${dist}"'
if(result != 0) {
if(result == 128) {
test_result = "tests failed " + result
} else {
test_result = "unknown failure " + result
}
}
}
}
}
stage('Postbuild') {
unstable_reason = (unstable_reason != "")? "(\${unstable_reason})" : ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment