Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy stage in CI #1929

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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