Skip to content

Commit 792deae

Browse files
author
Bulat Saifullin
authored
Added deploy Job (#1929)
1 parent d86c3ce commit 792deae

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

.gitlab-ci.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ stages:
55
- build
66
- publish
77
- publish-docker-description
8+
- deploy
89

910
variables:
1011
GIT_STRATEGY: fetch
@@ -77,6 +78,17 @@ default:
7778
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
7879
- if: $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
7980

81+
.deploy-refs: &deploy-refs
82+
rules:
83+
- if: $CI_PIPELINE_SOURCE == "pipeline"
84+
when: never
85+
- if: $SCHEDULED_JOB
86+
when: never
87+
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
88+
when: manual
89+
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/ # i.e. v2021-09-27, v2021-09-27-1
90+
when: manual
91+
8092
.nightly-test: &nightly-test
8193
rules:
8294
# 2. another is triggered by scripts repo $CI_PIPELINE_SOURCE == "pipeline" it's for the CI image
@@ -360,4 +372,27 @@ dockerhub-bridges-common-relay:
360372
variables:
361373
SHORT_DESCRIPTION: "bridges-common-relay"
362374

363-
# FIXME: publish binaries
375+
# FIXME: publish binaries
376+
377+
deploy-bridges-common-relay-testnet:
378+
<<: *deploy-refs
379+
needs:
380+
- job: bridges-common-relay
381+
stage: deploy
382+
image: argoproj/argocd:v2.5.5
383+
environment: parity-testnet
384+
variables:
385+
ARGOCD_OPTS: --grpc-web --grpc-web-root-path /parity-testnet
386+
APP: bridges-common-relay
387+
before_script:
388+
- if [[ "${CI_COMMIT_TAG}" ]]; then
389+
VERSION=${CI_COMMIT_TAG};
390+
elif [[ "${CI_COMMIT_REF_NAME}" ]]; then
391+
VERSION=$(echo ${CI_COMMIT_REF_NAME} | sed -r 's#/+#-#g');
392+
fi
393+
script:
394+
- echo "Starting deploy version=${VERSION}"
395+
- argocd app list
396+
- argocd app set $APP --helm-set bridges-common-relay.image.tag=$VERSION
397+
- argocd app sync $APP
398+
- argocd app wait $APP --timeout 120

0 commit comments

Comments
 (0)