AI
Size: a a a
AI
AI
HC
AI
AI
HC
jenkins.example.com на свойAI
HC
AI
AI
AI
ГВ
Н
Н
II
def withChroot(ch, action) {
def old_sh = sh
try {
sh = { echo "new sh"; old_sh """~/chroot.sh $ch <<CHROOT_SH_EOF
$it
CHROOT_SH_EOF"""
}
} finally {
sh = old_sh
}
}
node('chrysalis') {
withChroot('/var/lib/jenkins/gentoo') {
sh "emerge --help"
}
}
, но при запуске оно падает с No such property: sh for class: groovy.lang.Bindingdef old_sh = this.&sh, то оно почему-то уходит в бесконечную рекурсию и падает с StackOverflowErrorvk
withCredentials([на что-то типа
sshUserPrivateKey(credentialsId: 'xyi',keyFileVariable: 'identity')
]){
remote.identityFile = identity
}
II
def creds = { action ->
withCredentials([
sshUserPrivateKey(credentialsId: 'xyi',keyFileVariable: 'identity')
]) {
action()
}
}
creds {
remote.identityFile = identity
}M
steps {
catchError(message: 'catched', buildResult: 'SUCCESS', stageResult: 'UNSTABLE'){
script {
echo 'unstable'
unstable('unst')
}}}
объявляю стейдж нестабильным, а затем во всех последующих стейджах отрабатывает секция post для unstable
даже если все они завершились с успехомPN