From 781a10acedff64fcdd45cbd03a51b2aaf2ff2776 Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Nov 25 2024 18:55:47 +0000 Subject: [PATCH 1/2] 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 5b360bc..91895e8 100644 --- a/justfile +++ b/justfile @@ -466,10 +466,10 @@ upload-container variant=default_variant: skopeo login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" quay.io # Copy fully versioned tag (major version, build date/id, git commit) - skopeo copy --retry-times 3 "oci-archive:fedora-${variant}.ociarchive" "docker://${image}:${version}.${buildid}.${git_commit}" + skopeo copy --retry-times 3 "oci-archive:fedora-${variant}.ociarchive" "docker://${image}:${version}.${buildid}" # Update "un-versioned" tag (only major version) - skopeo copy --retry-times 3 "docker://${image}:${version}.${buildid}.${git_commit}" "docker://${image}:${version}" + skopeo copy --retry-times 3 "docker://${image}:${version}.${buildid}" "docker://${image}:${version}" if [[ "${variant}" == "kinoite-nightly" ]]; then # Update latest tag for kinoite-nightly only - skopeo copy --retry-times 3 "docker://${image}:${version}.${buildid}.${git_commit}" "docker://${image}:latest" + skopeo copy --retry-times 3 "docker://${image}:${version}.${buildid}" "docker://${image}:latest" fi From 83a9bcf874df4b425366927b46c6abf0e3276451 Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Dec 04 2024 17:39:17 +0000 Subject: [PATCH 2/2] gitlab-ci: Fix push/mr distinction and factor variants - Build on merge request, upload only on f40 branch commits - Factor variants definition - Skip YAML validation for .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2412ad8..7d2adc2 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: @@ -26,3 +22,22 @@ build: - lazurite - onyx - base + +# 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 == "f40" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule") diff --git a/ci/validate b/ci/validate index d9b90af..a72462c 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)