Jobs to synchronize images
This commit is contained in:
parent
d656739a27
commit
ec133cb4f0
@ -1,3 +1,6 @@
|
||||
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'
|
||||
@ -228,6 +231,42 @@ job('infra/configure-jenkins') {
|
||||
}
|
||||
*/
|
||||
|
||||
imageMap.each { url, hash ->
|
||||
def filename = Paths.get(new URI(url).getPath()).getFileName().toString()
|
||||
job("infra/sync-image-${filename}") {
|
||||
displayName("${filename}")
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user