[neon/snap-packaging/plasma-core-desktop-snap/ci-prototype] debian: deploy:
Carlos De Maine
null at kde.org
Mon May 6 08:09:35 BST 2024
Git commit 8a87150cb6f9d7255e311af5377a6d568cad807f by Carlos De Maine.
Committed on 06/05/2024 at 07:09.
Pushed by carlosdem into branch 'ci-prototype'.
deploy:
M +2 -2 debian/.gitlab-ci-neon.yml
A +23 -0 debian/snap-base-proto.yml
A +39 -0 debian/snap-image-snapcraft-lxd--proto.yml
https://invent.kde.org/neon/snap-packaging/plasma-core-desktop-snap/-/commit/8a87150cb6f9d7255e311af5377a6d568cad807f
diff --git a/debian/.gitlab-ci-neon.yml b/debian/.gitlab-ci-neon.yml
index a4177c2..28d0252 100644
--- a/debian/.gitlab-ci-neon.yml
+++ b/debian/.gitlab-ci-neon.yml
@@ -3,5 +3,5 @@
include:
- project: sysadmin/ci-utilities
- file:
- - /gitlab-templates/snap-snapcraft-lxd.yml
+ - local: debian/snap-image-snapcraft-lxd--proto.yml
+ - local: debian/snap-base-proto.yml
\ No newline at end of file
diff --git a/debian/snap-base-proto.yml b/debian/snap-base-proto.yml
new file mode 100644
index 0000000..9c36475
--- /dev/null
+++ b/debian/snap-base-proto.yml
@@ -0,0 +1,23 @@
+.snap_base:
+ stage: deploy
+ tags:
+ - Snap
+ variables:
+ KDE_SNAP_MODULE_NAME: ${CI_PROJECT_NAME}
+ SNAPCRAFT_BUILD_ENVIRONMENT: "host"
+ SNAPCRAFT_MANAGED_MODE: "y"
+ interruptible: true
+ before_script:
+ - git clone https://invent.kde.org/sysadmin/ci-utilities.git --depth=1
+ - git clone https://invent.kde.org/sysadmin/repo-metadata.git ci-utilities/repo-metadata/ --depth=1
+ script:
+ - git config --global --add safe.directory $CI_PROJECT_DIR
+ artifacts:
+ name: Snap artifacts
+ expose_as: 'KDE neon snaps'
+ when: always
+ paths:
+ - ".kde-ci-packages/"
+ - "task.log"
+ - "task-debug.log"
+ expire_in: 7 days
diff --git a/debian/snap-image-snapcraft-lxd--proto.yml b/debian/snap-image-snapcraft-lxd--proto.yml
new file mode 100644
index 0000000..cfa291c
--- /dev/null
+++ b/debian/snap-image-snapcraft-lxd--proto.yml
@@ -0,0 +1,39 @@
+include:
+ #- /gitlab-templates/blocks/snap-base.yml
+ - /gitlab-templates/blocks/workflow.yml
+
+snap_image_dangerous:
+ extends: .snap_base
+ inherit:
+ default: true
+ script:
+ # 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 image with the project's tooling
+ - echo building $KDE_SNAP_MODULE_NAME in dangerous mode ...
+ - make dangerous
+ # make the artifacts dir
+ - mkdir -p $CI_PROJECT_DIR/.kde-ci-packages/
+ # copy the gun zipped tar to the artifacts dir
+ - cp -vf $packageDir/*.tar.gz $CI_PROJECT_DIR/.kde-ci-packages/
+ interruptible: true
+ after_script:
+ # delete the gpg keyring
+ - rm -rf ¬/.snap/gnupg
+ # delete the snapcraft auth creds
+ - rm kde-neon-core-image-key
More information about the Neon-commits
mailing list