Skip to content

Commit

Permalink
Merge pull request #106 from infosiftr/save-deploy
Browse files Browse the repository at this point in the history
Speed up deploy optimistically
  • Loading branch information
tianon authored Jan 31, 2025
2 parents 5ea6680 + bedef05 commit 4f22d05
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,27 @@ node('put-shared') { ansiColor('xterm') {
include "deploy";
arch_tagged_manifests(env.BASHBREW_ARCH)
| deploy_objects[]
' builds.json | tee deploy.json
' builds.json > deploy.json
'''
}
stage('Filter') {
// using the previous successful deploy.json, filter the current deploy.json with items already pushed last time
sh'''
wget --timeout=5 -qO past-deploy.json "$JOB_URL/lastSuccessfulBuild/artifact/deploy.json"
# swap to this touch instead of the wget above to (re)bootstrap
#touch past-deploy.json
jq --slurpfile past ./past-deploy.json 'select( IN($past[]) | not )' ./deploy.json > filtered-deploy.json
'''
}
stage('Archive') {
archiveArtifacts(
artifacts: [
'deploy.json',
'filtered-deploy.json',
].join(','),
fingerprint: true,
)
}

withCredentials([
string(credentialsId: 'dockerhub-public-proxy', variable: 'DOCKERHUB_PUBLIC_PROXY'),
Expand All @@ -88,7 +106,7 @@ node('put-shared') { ansiColor('xterm') {
./.go-env.sh go build -trimpath -o bin/deploy ./cmd/deploy
fi
)
.scripts/bin/deploy < deploy.json
.scripts/bin/deploy < filtered-deploy.json
'''
}
}
Expand Down

0 comments on commit 4f22d05

Please sign in to comment.