Compare commits

...
2 Commits
Author SHA1 Message Date
cedric 0aecadb699 Merge pull request 'Create the releases directory before writing records' (#17) from fix-release-dir into main
seat-back-trivia/pipeline/head This commit looks good
Reviewed-on: #17
2026-11-04 23:46:13 +00:00
Cedric PollefeysandClaude Opus 5.5 0e2e5cba34 Create the releases directory before writing records
seat-back-trivia/pipeline/pr-main This commit looks good
The empty releases/ directory is not stored in git, so main build 8
failed after publishing the image. Delivery now also runs when ansible/
or the Jenkinsfile changes, so the delivery code itself goes through
staging and approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:40:08 -05:00
Vendored
+7 -6
View File
@@ -1,7 +1,7 @@
// Pull requests run tests and checks only. On main, a change under pricing/ // Pull requests run tests and checks only. On main, a change to pricing/,
// builds one image and promotes its digest from staging to production after a // ansible/ or this file builds one image and promotes its digest from staging
// human approval. Setting RELEASE_RECORD redeploys an existing release without // to production after a human approval. Setting RELEASE_RECORD redeploys an
// building, which is how rollback and recovery run. // existing release without building, which is how rollback and recovery run.
// Applies one release record with Ansible on the delivery agent. // Applies one release record with Ansible on the delivery agent.
def deploy(String record, String label) { def deploy(String record, String label) {
@@ -108,8 +108,8 @@ pipeline {
when { allOf { branch 'main'; expression { !params.RELEASE_RECORD } } } when { allOf { branch 'main'; expression { !params.RELEASE_RECORD } } }
steps { steps {
script { script {
env.DELIVER = sh(returnStatus: true, script: 'git diff --quiet HEAD^1 HEAD -- pricing') != 0 ? 'true' : 'false' env.DELIVER = sh(returnStatus: true, script: 'git diff --quiet HEAD^1 HEAD -- pricing ansible Jenkinsfile') != 0 ? 'true' : 'false'
echo "pricing/ changed: ${env.DELIVER}" echo "pricing/, ansible/ or Jenkinsfile changed: ${env.DELIVER}"
} }
} }
} }
@@ -143,6 +143,7 @@ pipeline {
withCredentials([usernamePassword(credentialsId: 'registry-write', usernameVariable: 'REG_USER', passwordVariable: 'REG_TOKEN')]) { withCredentials([usernamePassword(credentialsId: 'registry-write', usernameVariable: 'REG_USER', passwordVariable: 'REG_TOKEN')]) {
sh '''#!/bin/bash sh '''#!/bin/bash
set -euo pipefail set -euo pipefail
mkdir -p releases reports
export DOCKER_CONFIG=$(mktemp -d) export DOCKER_CONFIG=$(mktemp -d)
trap 'rm -rf "$DOCKER_CONFIG"' EXIT trap 'rm -rf "$DOCKER_CONFIG"' EXIT
printf '%s' "$REG_TOKEN" | docker login "${IMAGE%%/*}" -u "$REG_USER" --password-stdin printf '%s' "$REG_TOKEN" | docker login "${IMAGE%%/*}" -u "$REG_USER" --password-stdin