[neon/ubuntu-core/ago/generate-model-in-ci] debian: Merge both models into one pipeline

Antoine Gonzalez null at kde.org
Thu Jul 18 15:03:07 BST 2024


Git commit e40b3ced1a977ad8b7f5d9ed7bc457bd066c36a8 by Antoine Gonzalez.
Committed on 18/07/2024 at 14:03.
Pushed by daspood into branch 'ago/generate-model-in-ci'.

Merge both models into one pipeline

M  +1    -2    debian/.gitlab-ci-neon.yml
D  +0    -54   debian/snap-image-model-signed.yml
R  +17   -14   debian/snap-image-model.yml [from: debian/snap-image-model-dangerous.yml - 065% similarity]

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

diff --git a/debian/.gitlab-ci-neon.yml b/debian/.gitlab-ci-neon.yml
index 7875f1c..1d60f24 100644
--- a/debian/.gitlab-ci-neon.yml
+++ b/debian/.gitlab-ci-neon.yml
@@ -6,8 +6,7 @@ include:
     file:
       - /gitlab-templates/snap-image-dangerous.yml
   #      - /gitlab-templates/snap-image-signed.yml
-  - local: debian/snap-image-model-dangerous.yml
-#  - local: debian/snap-image-model-signed.yml
+  - local: debian/snap-image-model.yml
 default:
   before_script:
     - echo KDECI_GITLAB_TOKEN=$KDECI_GITLAB_TOKEN
\ No newline at end of file
diff --git a/debian/snap-image-model-signed.yml b/debian/snap-image-model-signed.yml
deleted file mode 100644
index fdb14ff..0000000
--- a/debian/snap-image-model-signed.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-include:
-  - project: sysadmin/ci-utilities
-    file:
-      - /gitlab-templates/blocks/snap-base.yml
-      - /gitlab-templates/blocks/workflow.yml
-
-snap_image_model_signed:
-  extends: .snap_base
-  inherit:
-    default: true
-  script:  # Have to duplicate most of the snap-image code as the default `make` command will remove the model file
-    # make sure there is a snap specific so gpg deosn't freak out
-    - mkdir -p -m 0700 ¬/.snap/gnupg/
-    - mkdir -p -m 0700 ¬/.snap/gnupg/private-keys-v1.d/
-    # export it as a env var for convenience
-    - export GNUPGHOME=¬/.snap/gnupg/
-    # test the env var
-    - echo $GNUPGHOME
-    # copy in the required exported login creds so that snapcraft whoami works
-    - echo $KDE_NEON_CORE_IMAGE_KEY > kde-neon-core-image-key
-    # feed snap's gpg the required key
-    - echo $PRIVATE_KEY | base64 --decode | gpg --batch --import
-    # make sure the key is trusted
-    - gpg --import-ownertrust <(echo "$OWNER_TRUST")
-    # test the keys
-    - gpg --list-keys
-    # test the login
-    - snapcraft whoami
-    # build the model with the project's tooling
-    - echo re-generating model for $KDE_SNAP_MODULE_NAME in signed mode ...
-    - make kde-neon-core-dangerous-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
-    - cp -vf ./*.model  $CI_PROJECT_DIR/.kde-ci-packages/
-    # push the new model to gitlab
-    - git config user.email "kde-neon-core-model-bot at kde.org"
-    - git config user.name "kde-neon-core model-bot"
-    - git remote add gitlab_origin https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git
-    - git add kde-neon-core-signed-amd64.model
-    - git status  # debug
-    - git commit -m "Update signed model file"
-    - git status  # debug
-    - echo "git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME -o ci.skip"  # debug
-    #- git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME -o ci.skip
-  interruptible: true
-  after_script:
-    # delete the gpg keyring
-    - rm -rf ¬/.snap/gnupg
-    # delete the snapcraft auth creds
-    - rm kde-neon-core-image-key
-  rules:
-    - changes:
-      - kde-neon-core-amd64.json  # Only re-generate the models when the base model file is changed
diff --git a/debian/snap-image-model-dangerous.yml b/debian/snap-image-model.yml
similarity index 65%
rename from debian/snap-image-model-dangerous.yml
rename to debian/snap-image-model.yml
index 866a7db..f3adb8f 100644
--- a/debian/snap-image-model-dangerous.yml
+++ b/debian/snap-image-model.yml
@@ -4,7 +4,7 @@ include:
       - /gitlab-templates/blocks/snap-base.yml
       - /gitlab-templates/blocks/workflow.yml
 
-snap_image_model_dangerous:
+snap_image_model:
   extends: .snap_base
   inherit:
     default: true
@@ -19,28 +19,31 @@ snap_image_model_dangerous:
     # copy in the required exported login creds so that snapcraft whoami works
     - echo $KDE_NEON_CORE_IMAGE_KEY > kde-neon-core-image-key
     # feed snap's gpg the required key
-    - echo $PRIVATE_KEY | base64 --decode | gpg --batch --import
+#    - echo $PRIVATE_KEY | base64 --decode | gpg --batch --import
     # make sure the key is trusted
-    - gpg --import-ownertrust <(echo "$OWNER_TRUST")
+#    - gpg --import-ownertrust <(echo "$OWNER_TRUST")
     # test the keys
-    - gpg --list-keys
+#    - gpg --list-keys
     # test the login
-    - snapcraft whoami
+#    - snapcraft whoami
     # build the model with the project's tooling
-    - echo re-generating model for $KDE_SNAP_MODULE_NAME in dangerous mode ...
-    - make kde-neon-core-dangerous-amd64.model 2>&1 | tee task.log
+#    - echo re-generating models for $KDE_SNAP_MODULE_NAME ...
+#    - make kde-neon-core-dangerous-amd64.model 2>&1 | tee task.log
+#    - make kde-neon-core-signed-amd64.model 2>&1 | tee task.log
     # make the artifacts dir
-    - mkdir -p $CI_PROJECT_DIR/.kde-ci-packages/
+#    - mkdir -p $CI_PROJECT_DIR/.kde-ci-packages/
     # copy the new model to the artifacts dir
-    - cp -vf ./*.model  $CI_PROJECT_DIR/.kde-ci-packages/
+#    - cp -vf ./*.model  $CI_PROJECT_DIR/.kde-ci-packages/
     # push the new model to gitlab
     - git config user.email "kde-neon-core-model-bot at kde.org"
     - git config user.name "kde-neon-core model-bot"
-    - git remote add gitlab_origin https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git
-    - git add kde-neon-core-dangerous-amd64.model
-    - git status  # debug
-    - git commit -m "Update signed model file"
-    - git status  # debug
+    - git status  # FIXME debug
+    - git remote -v  # FIXME debug
+    - git remote add gitlab_origin https://invent.kde.org/neon/ubuntu-core.git
+#    - git remote add gitlab_origin https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git
+#    - git add ./*.model
+#    - git status  # debug
+#    - git commit -m "Update model files"
     - echo "git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME -o ci.skip"  # debug
     #- git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME -o ci.skip
   interruptible: true


More information about the Neon-commits mailing list