Synchronization script invocation reconfigured

This commit is contained in:
Игорь Чудов 2019-10-04 15:43:49 +04:00
parent 54f656831e
commit 56567a7333
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -64,18 +64,30 @@ folder('infra') {
} }
} }
/*
* 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 -> platforms.each { platform ->
job("infra/sync-${platform}") { job("infra/sync-${platform}") {
displayName("Synchronize ALT Linux repos for ${platform}") displayName("Synchronize ALT Linux repos for ${platform}")
description('Runs synchronization script on PVE') description('Runs synchronization script on PVE')
// The job must be run on pve node
label('pve') label('pve')
environmentVariables { parameters {
// Directory to save repository to' stringParam('MIRRORS_DEST',
env('MIRRORS_DEST', mirrorsDest) mirrorsDest,
// Host to download files from 'Directory to save repository to')
env('MIRRORS_SRC', mirrorsSrc) stringParam('MIRRORS_SRC',
// ALT Linux branch to download mirrorsSrc,
env('PLATFORM', platform) 'Host to download files from')
stringParam('PLATFORM',
platform,
'ALT Linux branch to download')
} }
scm { scm {
git { git {
@ -90,10 +102,10 @@ platforms.each { platform ->
} }
} }
wrappers { wrappers {
sshAgent('robot_key', 'jenkins-gogs') sshAgent('robot_key')
} }
steps { steps {
shell(readFileFromWorkspace('scripts/sync_alt_repo')) shell("/usr/bin/env MIRRORS_DEST=${MIRRORS_DEST} MIRRORS_SRC=${MIRRORS_SRC} PLATFORM=${PLATFORM} ./scripts/sync_alt_repo")
} }
} }
} }