autojen/maintenance/alt-images/packer.groovy

61 lines
1.3 KiB
Groovy
Raw Normal View History

2018-11-06 11:13:20 +03:00
def baseName = 'maintenance/packer'
2019-07-17 13:04:15 +03:00
def target_names = ['alt-server', 'alt-workstation', 'alt-kworkstation']
def vms = ['qemu', 'onebula']
def platforms = ['8.2', '8.3', '8sp', '9', 'sisyphus']
def arch = 'x86_64'
2018-11-06 11:13:20 +03:00
def githubProject = 'altlinuxteam/alt-packer'
def githubBranch = 'jenkins'
def packerCachePath = '/data/iso_images/template/iso' // our PVE specific path
platforms.each { p ->
2019-07-17 13:04:15 +03:00
target_names.each { tname ->
2018-11-06 11:13:20 +03:00
vms.each { v ->
2019-07-17 13:04:15 +03:00
def jobName = "${baseName}-${v}-${tname}-${p}-${arch}"
2018-11-06 11:13:20 +03:00
job(jobName) {
label('kvm && bigmem && nix')
scm {
github(githubProject, githubBranch)
}
wrappers {
colorizeOutput()
timestamps()
}
steps {
shell("""#!/usr/bin/env bash
set -euo pipefail
set -x
rm -rf output-*
2019-07-17 13:04:15 +03:00
rm -rf onebula-*
rm -rf vbox-*
rm -rf qemu-*
2018-11-06 11:13:20 +03:00
rm -f results/*
nix-shell -p gnumake packer --run " \
make \
2019-07-17 13:04:15 +03:00
-e target=${tname} \
2018-11-06 11:13:20 +03:00
-e VM_TYPE=${v} \
2019-07-17 13:04:15 +03:00
-e BASE_VERSION=${p} \
2018-11-06 11:13:20 +03:00
-e TARGET_VERSION=${p} \
-e PACKER_CACHE_DIR=${packerCachePath} \
2019-07-17 13:04:15 +03:00
image"
2018-11-06 11:13:20 +03:00
2019-07-17 13:04:15 +03:00
for ext in tar.gz md5 sha1 box; do
mv results/${v}-${tname}-${p}-${arch}.\${ext} results/${tname}-${p}-${v}.\${ext}
2018-11-06 11:13:20 +03:00
done
""".stripIndent()
)
}
publishers {
archiveArtifacts {
pattern('results/*')
onlyIfSuccessful(true)
}
}
}
}
}
}
2019-07-17 13:04:15 +03:00