autojen/configure_jenkins.groovy

198 lines
3.6 KiB
Groovy
Raw Normal View History

def confrepo = 'http://gogs.srt/BaseALT/autojen.git'
2019-10-08 12:00:21 +03:00
def infraConfRepo = 'http://gogs.srt/BaseALT/infra-conf.git'
def infraRepo = 'https://github.com/altlinuxteam/infra.git'
2019-10-04 14:07:44 +03:00
folder('samba') {
displayName('Samba Team')
description('Jobs for Samba AD DC testing and deployment')
views {
listView('Testing') {
description('Samba AD DC tests')
filterBuildQueue()
filterExecutors()
columns {
status()
name()
buildButton()
}
jobs {
name('jenkins-krb5-sisyphus-1x1')
name('jenkins-samba-1x3')
name('jenkins-samba-2x2')
name('jenkins-samba-3x3')
name('jenkins-samba-8sp-1x3-pub')
name('jenkins-samba-8sp-3x3-pub')
name('jenkins-samba-9-3x3-pub')
name('jenkins-samba-sisyphus-1x3')
name('jenkins-samba-sisyphus-1x3-pub')
name('jenkins-samba-sisyphus-3x3')
name('jenkins-samba-sisyphus-3x3-pub')
}
}
}
}
def mirrorsDest = '/data/mirrors/alt'
def mirrorsSrc = 'mirror.yandex.ru'
def platforms = [
2019-10-04 15:30:54 +03:00
'c8',
'p8',
'p9'
2019-10-04 14:07:44 +03:00
]
def elbrusPlatforms = [
2019-10-04 14:09:03 +03:00
'c8',
'p8',
'p9',
2019-10-04 14:07:44 +03:00
'sisyphus'
]
2019-10-04 11:50:58 +03:00
folder('infra') {
displayName('Infrastructure')
description('Run Jenkins Job DSL to reconfigure master')
2019-10-04 12:21:12 +03:00
views {
2019-10-04 14:07:44 +03:00
listView('File synchronization') {
2019-10-04 12:21:12 +03:00
description('File synchronization')
filterBuildQueue()
filterExecutors()
columns {
status()
name()
buildButton()
}
jobs {
name('sync-c8')
name('sync-p8')
name('sync-p9')
2019-10-04 12:21:12 +03:00
}
}
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')
}
}
}
configure { view ->
view / defaultView('File synchronization')
2019-10-04 12:21:12 +03:00
}
}
2019-10-04 15:30:18 +03:00
/*
* 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()
}
}
}
}
*/
/*
* 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;
*/
2019-10-04 14:07:44 +03:00
platforms.each { platform ->
job("infra/sync-${platform}") {
2019-10-04 14:30:36 +03:00
displayName("Synchronize ALT Linux repos for ${platform}")
2019-10-04 14:07:44 +03:00
description('Runs synchronization script on PVE')
// The job must be run on pve node
2019-10-04 14:07:44 +03:00
label('pve')
2019-10-04 15:52:35 +03:00
logRotator {
numToKeep(5)
}
parameters {
stringParam('MIRRORS_DEST',
mirrorsDest,
'Directory to save repository to')
stringParam('MIRRORS_SRC',
mirrorsSrc,
'Host to download files from')
}
2019-10-04 14:07:44 +03:00
scm {
git {
remote {
name('origin')
url(confrepo)
}
branch('master')
extensions {
cleanAfterCheckout()
}
}
2019-10-04 14:07:44 +03:00
}
triggers {
cron('H 3,7,9 * * *')
}
2019-10-04 14:07:44 +03:00
steps {
2019-10-04 15:53:01 +03:00
shell('/usr/bin/env MIRRORS_DEST=${MIRRORS_DEST} MIRRORS_SRC=${MIRRORS_SRC} PLATFORM=' + platform + ' /bin/sh ./scripts/sync_alt_repo')
2019-10-04 14:07:44 +03:00
}
}
2019-10-04 11:50:58 +03:00
}
job('infra/switch-backup') {
displayName('Backup switch configuration')
description('Signals switches to dump active configuration to central storage')
label('pve')
logRotator {
numToKeep(5)
}
scm {
git {
remote {
name('origin')
url(confrepo)
}
branch('master')
extensions {
cleanAfterCheckout()
}
}
}
triggers {
cron('* 5 * * *')
}
steps {
shell('echo test')
}
}