Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up deploy optimistically #106

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -89,7 +107,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