#23 Add info about synchronizing k8s ConfigMaps and secrets in jobs

This commit is contained in:
Tomasz Sęk 2019-06-06 10:11:05 +02:00
parent 8c6f71bd10
commit d6e4ca7521
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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