[damned-lies] feat: add deploy jobs to push images
- From: Guillaume Bernard <gbernard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] feat: add deploy jobs to push images
- Date: Tue, 10 May 2022 08:30:03 +0000 (UTC)
commit 69f99ebd638bb79a62f807bc8d02412a5a57719d
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date: Mon May 9 15:06:23 2022 +0200
feat: add deploy jobs to push images
.gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c67b5c90..00a59ed9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -65,6 +65,7 @@ variables:
- mv containers/production/${KIND_OF_DEPLOYMENT} configuration
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}"
+ expose_as: "Container image"
paths:
- damned-lies-production_$CI_COMMIT_REF_NAME.tar
- configuration
@@ -247,3 +248,47 @@ code-string-changes:
################### Deploy ###################
#############################################################################
+.deploy:
+ extends: .job-on-buildah
+ script:
+ - IMAGE_ID="$(buildah pull -q oci-archive:damned-lies-production_$CI_COMMIT_REF_NAME.tar)"
+ - buildah tag "${IMAGE_ID}" "quay.io/gnome_infrastructure/damned-lies:${IMAGE_TAG_ON_REGISTRY}"
+ - buildah push "quay.io/gnome_infrastructure/damned-lies:${IMAGE_TAG_ON_REGISTRY}"
+
+
+deploy:staging:
+ extends: .deploy
+ stage: staging
+ variables:
+ IMAGE_TAG_ON_REGISTRY: "staging"
+ dependencies:
+ - build_container:production
+ rules:
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+ when: on_success
+
+
+deploy:production:
+ extends: .deploy
+ stage: production
+ variables:
+ IMAGE_TAG_ON_REGISTRY: "latest"
+ dependencies:
+ - build_container:production
+ rules:
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+ when: manual
+ - when: never
+
+
+deploy:test:
+ extends: .deploy
+ stage: production
+ variables:
+ IMAGE_TAG_ON_REGISTRY: "testing"
+ dependencies:
+ - build_container:test
+ rules:
+ - if: $CI_COMMIT_BRANCH == "develop"
+ when: on_success
+ - when: never
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]