forked from Blockstream/esplora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (72 loc) · 2.24 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
variables:
CI_DISPOSABLE_ENVIRONMENT: "true"
BULLSEYE_IMAGE: debian:bullseye@sha256:4d6ab716de467aad58e91b1b720f0badd7478847ec7a18f66027d0f8a329a43c
IMAGE_BASE: blockstream/esplora-base
IMAGE: blockstream/esplora
DOCKERHUB_ESPLORA_URL: "https://hub.docker.com/v2/repositories/blockstream/esplora/tags/"
stages:
- build
- plan
- deploy
default:
image: blockstream/gcloud-docker-tf:1.3.8
tags:
- cloud
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- stuck_or_timeout_failure
include:
- gitlab/**.yaml
## disables MR-triggered pipelines and allows only branch-triggered pipelines
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- when: always
plan_main:
extends: .tf_setup
stage: deploy
only:
- /^main_v.*/
script:
- (echo -n "$V3_PK" > terraform/modules/tor/v3.pk)
- (echo -n "$V3_PUBK" > terraform/modules/tor/v3.pubk)
- (cd terraform && terraform init -input=false &&
terraform workspace select main &&
terraform init -input=false &&
terraform plan
-var "prometheus_allowed_source_ip=$PROMETHEUS_ALLOWED_SOURCE_IP"
-var "hosts=$HOSTS"
-var "hosts_onion=$HOSTS_ONION"
-var "cluster_size=$NODE_CLUSTER_SIZE"
-var "instance_type=$NODE_INSTANCE_TYPE"
-var "regions=$REGIONS"
-var "zones=$ZONES"
-var "ssl_certs=$SSL_CERTS"
-var "image_source_project=$IMAGE_SOURCE_PROJECT"
-input=false)
deploy_main:
extends: .tf_setup
when: manual
only:
- /^main_v.*/
script:
- (echo -n "$V3_PK" > terraform/modules/tor/v3.pk)
- (echo -n "$V3_PUBK" > terraform/modules/tor/v3.pubk)
- (cd terraform && terraform init -input=false &&
terraform workspace select main &&
terraform init -input=false &&
terraform apply
-var "prometheus_allowed_source_ip=$PROMETHEUS_ALLOWED_SOURCE_IP"
-var "hosts=$HOSTS"
-var "hosts_onion=$HOSTS_ONION"
-var "cluster_size=$NODE_CLUSTER_SIZE"
-var "instance_type=$NODE_INSTANCE_TYPE"
-var "regions=$REGIONS"
-var "zones=$ZONES"
-var "ssl_certs=$SSL_CERTS"
-var "image_source_project=$IMAGE_SOURCE_PROJECT"
-input=false -auto-approve)