[gnome-build-meta/abderrahim/images-s3: 4/4] .gitlab-ci.yml: deploy VM images to S3




commit 152113e701086e6b02ef8473e7cd68d7bc3243f3
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Wed Aug 12 11:12:36 2020 +0100

    .gitlab-ci.yml: deploy VM images to S3
    
    Images are deployed nightly for master and on tags (for releases)

 .gitlab-ci.yml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3e5a940f..593dc5df 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -261,6 +261,31 @@ raspberrypi-4-image:
   variables:
     IMAGE: boards/raspberrypi-4/image.bst
 
+s3-image:
+  extends: .x86_64
+  stage: deploy
+  dependencies: [track]
+  script:
+    - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${IMAGE}"
+    - ${BST} -o arch "${ARCH}" checkout --hardlinks "${IMAGE}" image
+
+    - |
+      if [ -n "$CI_COMMIT_TAG" ]; then
+          aws s3 cp --acl public-read --expires $(date -I --date="6 weeks") image/disk.img.xz \\
+              s3://gnome-build-meta/$CI_COMMIT_TAG/disk.img.xz
+      elif
+          aws s3 cp --acl public-read --expires $(date -I --date="1 week") image/disk.img.xz \\
+              s3://gnome-build-meta/$CI_PIPELINE_ID/disk.img.xz
+      fi
+
+    - aws s3 ls --recursive --human-readable s3://gnome-build-meta/
+
+  rules:
+  - if: $EMERGENCY || $BST_TRACK_TAGS != "False"
+    when: never
+  - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"
+  - if: $CI_COMMIT_TAG
+
 
 ostree-x86_64:
   extends:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]