forked from blue-harvest/terraform-aws-blueharvest-eks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
43 lines (38 loc) · 1.15 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
image:
name: hashicorp/terraform:0.11.11
entrypoint: ["/bin/sh", "-c"]
stages:
- build
- deploy
plan:
stage: build
tags:
- blueharvest
- terraform
before_script:
- export TF_VAR_cluster_zone=blueharvest.io
- export TF_VAR_cluster_zone_id=Z31OVNF5EA1VAW
- export [email protected]
- terraform --version
- terraform init -force-copy=true
script:
- terraform validate
publish:
image: giannisp/node-docker-awscli:1.2.1
stage: deploy
when: on_success
dependencies:
- plan
tags:
- blueharvest
- terraform
before_script:
- apt-get update
- apt-get install -y zip unzip
script:
- export VERSION=${CI_COMMIT_SHA:0:8}
- export BRANCH="beta"
- if [ $CI_COMMIT_REF_NAME == "master" ]; then export BRANCH="release"; fi
- zip -r terraform-aws-blueharvest-eks.zip ./ -x .git/**\*
- aws s3 cp terraform-aws-blueharvest-eks.zip s3://blueharvest-terraform-registry/terraform-aws-blueharvest-eks-${VERSION}.zip --acl authenticated-read
- aws s3 cp terraform-aws-blueharvest-eks.zip s3://blueharvest-terraform-registry/terraform-aws-blueharvest-eks-${BRANCH}.zip --acl authenticated-read