From 4455dfd0cd69c926981eb18349a0b076384ab592 Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Dec 04 2024 17:32:07 +0000 Subject: [PATCH 1/3] justfile: Remove git commits from tag name Let's get us closer to what we want to see for the official images. See: https://pagure.io/cloud-image-uploader/issue/37 --- diff --git a/justfile b/justfile index 00a2cce..ce3bbef 100644 --- a/justfile +++ b/justfile @@ -397,17 +397,17 @@ upload-container variant=default_variant: # Copy fully versioned tag (major version, build date/id, git commit) skopeo copy ${SKOPEO_ARGS} \ "oci-archive:${variant}.ociarchive" \ - "docker://${image}:${version}.${buildid}.${git_commit}" + "docker://${image}:${version}.${buildid}" # Update "un-versioned" tag (only major version) skopeo copy ${SKOPEO_ARGS} \ - "docker://${image}:${version}.${buildid}.${git_commit}" \ + "docker://${image}:${version}.${buildid}" \ "docker://${image}:${version}" if [[ "${variant}" == "kinoite-nightly" ]]; then # Update latest tag for kinoite-nightly only skopeo copy ${SKOPEO_ARGS} \ - "docker://${image}:${version}.${buildid}.${git_commit}" \ + "docker://${image}:${version}.${buildid}" \ "docker://${image}:latest" fi @@ -420,10 +420,10 @@ upload-container variant=default_variant: # Copy fully versioned tag (major version, build date/id, git commit) skopeo copy ${SKOPEO_ARGS} \ "oci-archive:${variant}.ociarchive" \ - "docker://${image}:${version}.${buildid}.${git_commit}" + "docker://${image}:${version}.${buildid}" # Update "un-versioned" tag (only major version) skopeo copy ${SKOPEO_ARGS} \ - "docker://${image}:${version}.${buildid}.${git_commit}" \ + "docker://${image}:${version}.${buildid}" \ "docker://${image}:${version}" fi From c893b419158474618763664581341d4acdf1c44d Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Dec 04 2024 17:32:22 +0000 Subject: [PATCH 2/3] justfile: Stop copy to legacy names --- diff --git a/justfile b/justfile index ce3bbef..9ae7ed0 100644 --- a/justfile +++ b/justfile @@ -22,15 +22,6 @@ pretty_names := '( [cosmic-atomic]="COSMIC Atomic" )' -# Legacy names, used to keep some references stable -legacy_names := '( - [base-atomic]="base" - [budgie-atomic]="onyx" - [lxqt-atomic]="lazurite" - [sway-atomic]="sericea" - [xfce-atomic]="vauxite" -)' - # subset of the map from https://pagure.io/pungi-fedora/blob/main/f/general.conf volume_id_substitutions := '( [silverblue]="SB" @@ -410,20 +401,3 @@ upload-container variant=default_variant: "docker://${image}:${version}.${buildid}" \ "docker://${image}:latest" fi - - # Copy to legacy names if needed - declare -A legacy_names={{legacy_names}} - variant_legacy=${legacy_names[$variant]-} - if [[ -n ${variant_legacy} ]]; then - image="quay.io/fedora-ostree-desktops/${variant_legacy}" - - # Copy fully versioned tag (major version, build date/id, git commit) - skopeo copy ${SKOPEO_ARGS} \ - "oci-archive:${variant}.ociarchive" \ - "docker://${image}:${version}.${buildid}" - - # Update "un-versioned" tag (only major version) - skopeo copy ${SKOPEO_ARGS} \ - "docker://${image}:${version}.${buildid}" \ - "docker://${image}:${version}" - fi From d5c8d2631391ed337edc05b53cfebd97bc5439bb Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Dec 04 2024 17:33:09 +0000 Subject: [PATCH 3/3] gitlab-ci: Fix push/mr distinction and factor variants - Build on merge request, upload only on f41 branch commits - Factor variants definition - Skip YAML validation for .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3106c37..f90c395 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,11 +11,7 @@ stages: - build # As those are not official images, we build all available variants -build: - stage: build - script: - - just compose-image $VARIANT - - just upload-container $VARIANT +.parallel: parallel: matrix: - VARIANT: @@ -28,3 +24,22 @@ build: - budgie-atomic - base-atomic - cosmic-atomic + +# Only build the images for merge requests +buildmr: + stage: build + script: + - just compose-image $VARIANT + parallel: !reference [.parallel, parallel] + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + +# Build and upload the images for commits pushed to the branch & scheduled pipelines +build: + stage: build + script: + - just compose-image $VARIANT + - just upload-container $VARIANT + parallel: !reference [.parallel, parallel] + rules: + - if: $CI_COMMIT_BRANCH == "f41" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule") diff --git a/ci/validate b/ci/validate index 6f21443..8660ee1 100755 --- a/ci/validate +++ b/ci/validate @@ -25,6 +25,9 @@ for root, dirs, files, rootfd in os.fwalk('.'): for d in ['.git', 'repo', 'cache', 'tmp', 'logs', 'fedora-comps']: if d in dirs: dirs.remove(d) + for f in ['.gitlab-ci.yml']: + if f in files: + files.remove(f) for name in files: if name.endswith(('.yaml', '.yml')): print("Validating:", name)