342 lines
6.5 KiB
Groovy
342 lines
6.5 KiB
Groovy
import java.net.URI
|
|
import java.nio.file.Paths
|
|
|
|
def confrepo = 'http://gogs.srt/BaseALT/autojen.git'
|
|
def infraConfRepo = 'http://gogs.srt/BaseALT/infra-conf.git'
|
|
def infraRepo = 'https://github.com/altlinuxteam/infra.git'
|
|
|
|
def stackSamba = [
|
|
'jenkins-samba-1x3',
|
|
'jenkins-samba-3x3',
|
|
'jenkins-samba-8sp-1x3-pub',
|
|
'jenkins-samba-8sp-3x3-pub',
|
|
'jenkins-samba-9-3x3-pub',
|
|
'jenkins-samba-sisyphus-1x3',
|
|
'jenkins-samba-sisyphus-1x3-pub',
|
|
'jenkins-samba-sisyphus-3x3-pub',
|
|
'jenkins-samba-sisyphus-3x3'
|
|
]
|
|
|
|
def stackKerberos = [
|
|
'jenkins-krb5-sisyphus-1x1'
|
|
]
|
|
|
|
folder('samba') {
|
|
displayName('Samba Team')
|
|
description('Jobs for Samba AD DC testing and deployment')
|
|
views {
|
|
listView('Samba stacks') {
|
|
description('Samba AD DC tests')
|
|
filterBuildQueue()
|
|
filterExecutors()
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
stackSamba.each { stack ->
|
|
name(stack)
|
|
}
|
|
}
|
|
}
|
|
listView('Kerberos stacks') {
|
|
description('Kerberos stacks')
|
|
filterBuildQueue()
|
|
filterExecutors()
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
stackKerberos.each { stack ->
|
|
name(stack)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def mirrorsDest = '/data/mirrors/alt'
|
|
def mirrorsSrc = 'mirror.yandex.ru'
|
|
|
|
def platforms = [
|
|
'c8',
|
|
'p8',
|
|
'p9'
|
|
]
|
|
|
|
def elbrusBracnhes = [
|
|
'c8',
|
|
'p8',
|
|
'p9',
|
|
'sisyphus'
|
|
]
|
|
|
|
def imageMap = [:]
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p8/images/workstation/alt-workstation-8.2.1-20190906-x86_64-ru-install-dvd5.iso',
|
|
'4cee4be0ea4376a8c66a5d683b67818cf5e7dc20'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p8/images/server/alt-server-8.2.1-20190906-x86_64-ru-install-dvd5.iso',
|
|
'4656c0dc51064514da306dfc98539ce0cbee6b28'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p8/images/kworkstation/alt-kworkstation-8.3-install-x86_64.iso',
|
|
'77d28eb143efaeeb648d7e322a28d2347f1370b6'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p9/images/server/alt-server-20191009_rc4-x86_64.iso',
|
|
'774171f1b76a81cda777c4a1c1a2c4107406c589'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p9/images/server/alt-server-20191009_rc4-aarch64.iso',
|
|
'9ba2c96da97ba5423f2b0f6404e6feb2a27fe614'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p9/images/workstation/x86_64/alt-workstation-8.991_rc2-x86_64.iso',
|
|
'NONE'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p9/images/workstation/aarch64/alt-workstation-8.991_rc2-aarch64.iso',
|
|
'NONE'
|
|
)
|
|
|
|
imageMap.put(
|
|
'http://ftp.altlinux.org/pub/distributions/ALTLinux/p9/images/workstation/mipsel/tavolga-alt-workstation-8.920_beta2-mipsel.recovery.tar',
|
|
'897ad0bbd0cd4770f0cfefac343d6a045fab82ae'
|
|
)
|
|
|
|
folder('infra') {
|
|
displayName('Infrastructure')
|
|
description('Run Jenkins Job DSL to reconfigure master')
|
|
views {
|
|
sectionedView('File synchronization') {
|
|
description('File synchronization')
|
|
filterBuildQueue()
|
|
filterExecutors()
|
|
sections {
|
|
listView {
|
|
name('Images')
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
//regex('sync-image-.*')
|
|
}
|
|
}
|
|
listView {
|
|
name('AMD64')
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
name("sync-c8")
|
|
name("sync-p8")
|
|
name("sync-p9")
|
|
}
|
|
}
|
|
listView {
|
|
name('MCST e2k')
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
name("sync-e2k-c8")
|
|
name("sync-e2k-p8")
|
|
name("sync-e2k-p9")
|
|
}
|
|
}
|
|
listView {
|
|
name('MIPS32 LE')
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
}
|
|
listView {
|
|
name('Aarch64')
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
listView('Backups') {
|
|
description('Jobs to backup various artifacts')
|
|
filterBuildQueue()
|
|
filterExecutors()
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
name('switch-backup')
|
|
}
|
|
}
|
|
|
|
listView('etc') {
|
|
description('Uncategorized jobs')
|
|
filterBuildQueue()
|
|
filterExecutors()
|
|
columns {
|
|
status()
|
|
name()
|
|
buildButton()
|
|
}
|
|
jobs {
|
|
name('configure-jenkins')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Job to configure Jenkins
|
|
|
|
job('infra/configure-jenkins') {
|
|
displayName('Configure Jenkins')
|
|
description('Apply Jenkins configuration')
|
|
scm {
|
|
git {
|
|
remote {
|
|
name('origin')
|
|
url(confrepo)
|
|
}
|
|
branch('master')
|
|
extensions {
|
|
cleanAfterCheckout()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
job("infra/sync-image-test") {
|
|
displayName("test")
|
|
description('Synchronize image')
|
|
label('pve')
|
|
logRotator {
|
|
numToKeep(10)
|
|
}
|
|
parameters {
|
|
stringParam('IMAGES_DEST',
|
|
mirrorsDest,
|
|
'Directory to save images to')
|
|
}
|
|
scm {
|
|
git {
|
|
remote {
|
|
name('origin')
|
|
url(confrepo)
|
|
}
|
|
branch('master')
|
|
extensions {
|
|
cleanAfterCheckout()
|
|
}
|
|
}
|
|
}
|
|
triggers {
|
|
// Make a pause for sync during working hours
|
|
//cron('H 3,7,9,20,23 * * *')
|
|
}
|
|
steps {
|
|
//shell("/usr/bin/env IMAGES_DEST=" + '${IMAGES_DEST}' + "IMAGE=${url} HASH=${hash} /bin/sh ./scripts/sync_image")
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Generate jobs to syncrinize various repos. The process looks like
|
|
* this:
|
|
* 1) Checkout this repo;
|
|
* 2) Run synchronization script with paths set via environment
|
|
* variables;
|
|
* 3) Cleanup workspace;
|
|
*/
|
|
platforms.each { platform ->
|
|
job("infra/sync-${platform}") {
|
|
displayName("Synchronize ALT Linux repos for ${platform}")
|
|
description('Runs synchronization script on PVE')
|
|
// The job must be run on pve node
|
|
label('pve')
|
|
logRotator {
|
|
numToKeep(10)
|
|
}
|
|
parameters {
|
|
stringParam('MIRRORS_DEST',
|
|
mirrorsDest,
|
|
'Directory to save repository to')
|
|
stringParam('MIRRORS_SRC',
|
|
mirrorsSrc,
|
|
'Host to download files from')
|
|
}
|
|
scm {
|
|
git {
|
|
remote {
|
|
name('origin')
|
|
url(confrepo)
|
|
}
|
|
branch('master')
|
|
extensions {
|
|
cleanAfterCheckout()
|
|
}
|
|
}
|
|
}
|
|
triggers {
|
|
// Make a pause for sync during working hours
|
|
cron('H 3,7,9,20,23 * * *')
|
|
}
|
|
steps {
|
|
shell('/usr/bin/env MIRRORS_DEST=${MIRRORS_DEST} MIRRORS_SRC=${MIRRORS_SRC} PLATFORM=' + platform + ' /bin/sh ./scripts/sync_alt_repo')
|
|
}
|
|
}
|
|
}
|
|
|
|
job('infra/switch-backup') {
|
|
displayName('Backup switch configuration')
|
|
description('Signals switches to dump active configuration to central storage')
|
|
label('pve')
|
|
logRotator {
|
|
numToKeep(20)
|
|
}
|
|
scm {
|
|
git {
|
|
remote {
|
|
name('origin')
|
|
url(confrepo)
|
|
}
|
|
branch('master')
|
|
extensions {
|
|
cleanAfterCheckout()
|
|
}
|
|
}
|
|
}
|
|
triggers {
|
|
// Synchronize every 5 hours
|
|
cron('H 5,10,15,20 * * *')
|
|
}
|
|
steps {
|
|
shell('echo test')
|
|
}
|
|
}
|
|
|