Skip to content

Commit

Permalink
Added deploy Job (#1929)
Browse files Browse the repository at this point in the history
  • Loading branch information
BulatSaif authored Mar 3, 2023
1 parent d86c3ce commit 792deae
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ stages:
- build
- publish
- publish-docker-description
- deploy

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

.deploy-refs: &deploy-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $SCHEDULED_JOB
when: never
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
when: manual
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/ # i.e. v2021-09-27, v2021-09-27-1
when: manual

.nightly-test: &nightly-test
rules:
# 2. another is triggered by scripts repo $CI_PIPELINE_SOURCE == "pipeline" it's for the CI image
Expand Down Expand Up @@ -360,4 +372,27 @@ dockerhub-bridges-common-relay:
variables:
SHORT_DESCRIPTION: "bridges-common-relay"

# FIXME: publish binaries
# FIXME: publish binaries

deploy-bridges-common-relay-testnet:
<<: *deploy-refs
needs:
- job: bridges-common-relay
stage: deploy
image: argoproj/argocd:v2.5.5
environment: parity-testnet
variables:
ARGOCD_OPTS: --grpc-web --grpc-web-root-path /parity-testnet
APP: bridges-common-relay
before_script:
- if [[ "${CI_COMMIT_TAG}" ]]; then
VERSION=${CI_COMMIT_TAG};
elif [[ "${CI_COMMIT_REF_NAME}" ]]; then
VERSION=$(echo ${CI_COMMIT_REF_NAME} | sed -r 's#/+#-#g');
fi
script:
- echo "Starting deploy version=${VERSION}"
- argocd app list
- argocd app set $APP --helm-set bridges-common-relay.image.tag=$VERSION
- argocd app sync $APP
- argocd app wait $APP --timeout 120

0 comments on commit 792deae

Please sign in to comment.