-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuildspec_deploy_front.yaml
More file actions
31 lines (30 loc) · 1021 Bytes
/
buildspec_deploy_front.yaml
File metadata and controls
31 lines (30 loc) · 1021 Bytes
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
---
version: 0.2
phases:
pre_build:
commands:
- git clone https://github.com/tfutils/tfenv.git ~/.tfenv
- ln -s ~/.tfenv/bin/* /usr/local/bin
build:
commands:
- echo $DEPLOY_SUBDOMAIN
- echo $DEPLOY_PURPOSE
- echo $SWITCH_TARGET
#########################
- echo "Set for codebuild"
- cd ./envs/dev/app/
- make for-codebuild
#########################
- echo "Run Deploy Frontend"
- cd ./front/
- aws ssm get-parameter --name "/egihssystem/terraform/frontvars" | jq -r .Parameter.Value > ./terraform.tfvars
- tfenv use
- terraform init -input=false -no-color
- terraform workspace show
- terraform workspace select $DEPLOY_SUBDOMAIN || terraform workspace new $DEPLOY_SUBDOMAIN
- terraform plan -input=false -no-color
- terraform apply -input=false -no-color -auto-approve -var='target='$SWITCH_TARGET
- echo "congratulations!!"
post_build:
commands:
- echo "Now Finished Front"