[neon/ubuntu-core/models.add-models-pipeline] debian: Try to fix runner's git state

Antoine Gonzalez null at kde.org
Wed Aug 7 16:11:23 BST 2024


Git commit 0e63c4153ad3f19a6345aefbf188e43a34750d2c by Antoine Gonzalez.
Committed on 07/08/2024 at 15:11.
Pushed by daspood into branch 'models.add-models-pipeline'.

Try to fix runner's git state

M  +9    -10   debian/neon-core-models.yml

https://invent.kde.org/neon/ubuntu-core/-/commit/0e63c4153ad3f19a6345aefbf188e43a34750d2c

diff --git a/debian/neon-core-models.yml b/debian/neon-core-models.yml
index c33797d..828810e 100644
--- a/debian/neon-core-models.yml
+++ b/debian/neon-core-models.yml
@@ -8,6 +8,11 @@ neon_core_models:
   extends: .snap_base
   inherit:
     default: true
+  before_script:
+    # set bot identity and switch to the correct branch
+    - git config user.email "project_17308_bot_bfe008c722508de9710d4b73ec01c4a0 at invent.kde.org"
+    - git config user.name "Neon Core-Bot"
+    - git checkout "$CI_COMMIT_REF_NAME"
   script:
     # make sure there is a snap specific so gpg doesn't freak out
     - mkdir -p -m 0700 ¬/.snap/gnupg/
@@ -32,17 +37,8 @@ neon_core_models:
     - make kde-neon-core-signed-amd64.model 2>&1 | tee task.log
     # make the artifacts dir
     - mkdir -p $CI_PROJECT_DIR/.kde-ci-packages/
-    # copy the new model to the artifacts dir
+    # copy the new models to the artifacts dir
     - cp -vf ./*.model  $CI_PROJECT_DIR/.kde-ci-packages/
-    # set our identity
-    - git config user.email "project_17308_bot_bfe008c722508de9710d4b73ec01c4a0 at invent.kde.org"
-    - git config user.name "Neon Core-Bot"
-    # FIXME: debugging the CI
-    - git fetch
-    - git status
-    - git log -5 --oneline --graph
-    - git branch -a
-    - echo "$CI_COMMIT_REF_NAME"
     # add the model and commit
     - git add -f ./kde-neon-core-dangerous-amd64.model ./kde-neon-core-signed-amd64.model
     - git commit -m "Update models"
@@ -50,6 +46,9 @@ neon_core_models:
     - git push https://project_17308_bot_bfe008c722508de9710d4b73ec01c4a0:$GIT_MODEL_COMMIT@invent.kde.org/neon/ubuntu-core.git $CI_COMMIT_REF_NAME -o ci.skip
   interruptible: true
   after_script:
+    # cleanup local branches to avoid outdated states in future runs
+    - git checkout "$CI_COMMIT_SHA"
+    - git branch -D "$CI_COMMIT_REF_NAME"
     # delete the gpg keyring
     - rm -rf ¬/.snap/gnupg
     # delete the snapcraft auth creds


More information about the Neon-commits mailing list