Skip to content

Commit

Permalink
terraform: migrated to different solution (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeviaVir authored Oct 31, 2024
1 parent 39c563a commit dce54c3
Show file tree
Hide file tree
Showing 39 changed files with 29 additions and 2,288 deletions.
46 changes: 0 additions & 46 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,49 +30,3 @@ workflow:
- 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)
25 changes: 0 additions & 25 deletions gitlab/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,3 @@
extends: .dind_setup
rules:
- if: $CI_COMMIT_BRANCH

.tf_setup:
stage: deploy
before_script:
- curl -s "${DOCKERHUB_ESPLORA_URL}" | grep -q "${CI_COMMIT_SHA}" ||
(echo "No such image blockstream/esplora:${CI_COMMIT_SHA}. Needs to be built."; exit 1)
- TMPF=$(mktemp) || exit 1
- echo $GCLOUD_KEY > $TMPF
- export GOOGLE_APPLICATION_CREDENTIALS=$TMPF
- gcloud auth activate-service-account --key-file=$TMPF
- gcloud auth list
- gcloud --version

.k8s_setup:
stage: deploy
when: manual
image: blockstream/kubectl:v1.24.8
before_script:
- curl -s "${DOCKERHUB_ESPLORA_URL}" | grep -q "${CI_COMMIT_SHA}" ||
(echo "No such image blockstream/esplora:${CI_COMMIT_SHA}. Needs to be built."; exit 1)
- kubectl --server=$KUBE_SERVER_US --token=$KUBE_TOKEN_US version
script:
- |
kubectl --v=8 --server=$KUBE_SERVER_US --token=$KUBE_TOKEN_US \
-n $KUBE_NAMESPACE set image $KUBE_WORKLOAD $KUBE_CONTAINER=$IMAGE:$CI_COMMIT_SHA
191 changes: 0 additions & 191 deletions gitlab/prod.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions gitlab/staging.yaml

This file was deleted.

59 changes: 0 additions & 59 deletions terraform/.terraform.lock.hcl

This file was deleted.

Loading

0 comments on commit dce54c3

Please sign in to comment.