FIX: Rebuild fails when tracked `version` switches from branch to tag
authorGerhard Schlager <gerhard.schlager@discourse.org>
Thu, 13 Apr 2023 10:39:19 +0000 (12:39 +0200)
committerGerhard Schlager <mail@gerhard-schlager.at>
Wed, 19 Apr 2023 13:53:10 +0000 (15:53 +0200)
We are replacing the `beta` branch with a tag of the same name. Rebuilding a container will fail when a user tracks the `beta` version and the base image was built at a time where `beta` was still a branch. This resolves that by pruning tags and branches and forcing an update of tags during the rebuild.

templates/web.template.yml

index a9ab8bac0b6aa932ecc2334cf1561b85204fc5b4..4c4f950591a669e25827c60ec8311b35626a63fe 100644 (file)
@@ -96,7 +96,7 @@ run:
                 git remote set-branches origin $version
                 git fetch --depth 1 origin $version
             else
-                git fetch --prune --prune-tags origin $version
+                git fetch --tags --prune-tags --prune --force origin
             fi
           '
         - |-