mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-08 09:01:15 +02:00
#23 Add info about synchronizing k8s ConfigMaps and secrets in jobs
This commit is contained in:
@@ -166,6 +166,9 @@ node('master') {
|
||||
configs.addAll(configsText.tokenize('\n'))
|
||||
|
||||
stage('Synchronizing files') {
|
||||
println "Synchronizing Kubernetes ConfigMaps and Secrets to the Jenkins master pod."
|
||||
println "This step may fail and will be retried in the next job build if necessary."
|
||||
|
||||
synchronizeFiles(secretsPath, (String[])secrets, userConfigurationSecretExpectedHash)
|
||||
synchronizeFiles(configsPath, (String[])configs, userConfigurationExpectedHash)
|
||||
}
|
||||
@@ -183,7 +186,7 @@ def synchronizeFiles(String path, String[] files, String hash) {
|
||||
def complete = false
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
def actualHash = calculateHash(files, path)
|
||||
println "Expected hash '${hash}', actual hash '${actualHash}', path '${path}'"
|
||||
println "Expected hash '${hash}', actual hash '${actualHash}', path '${path}', will retry"
|
||||
if(hash == actualHash) {
|
||||
complete = true
|
||||
break
|
||||
|
||||
@@ -108,10 +108,13 @@ node('master') {
|
||||
scripts.addAll(scriptsText.tokenize('\n'))
|
||||
|
||||
stage('Synchronizing files') {
|
||||
println "Synchronizing Kubernetes ConfigMaps to the Jenkins master pod."
|
||||
println "This step may fail and will be retried in the next job build if necessary."
|
||||
|
||||
def complete = false
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
def actualHash = calculateHash((String[])scripts, scriptsPath)
|
||||
println "Expected hash '${expectedHash}', actual hash '${actualHash}'"
|
||||
println "Expected hash '${expectedHash}', actual hash '${actualHash}', will retry"
|
||||
if(expectedHash == actualHash) {
|
||||
complete = true
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user