-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yaml
30 lines (26 loc) · 1.08 KB
/
buildspec.yaml
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
version: 0.2
phases:
install:
runtime-versions:
python: 3.8
commands:
- curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.85.0/hugo_0.85.0_Linux-64bit.deb
- dpkg -i hugo.deb
- curl -s -qL -o terraform.zip https://releases.hashicorp.com/terraform/1.0.1/terraform_1.0.1_linux_amd64.zip
- unzip -qq terraform.zip -d infrastructure/
build:
commands:
- cd website/
- git init
- git submodule add https://github.com/hugo-toha/toha.git themes/toha
- hugo
post_build:
commands:
- cd ../infrastructure/
- $PWD/terraform init -backend-config=bucket=$BUCKET_NAME -backend-config=dynamodb_table=$DYNAMODB_NAME -backend-config=key=$GITHUB_REPO -backend-config=region=$AWS_REGION
- $PWD/terraform plan -target module.frontend -out=tfplan -var-file=pro.tfvars -var=aws_region=$AWS_REGION -var=github_token=$GITHUB_TOKEN -var=alerting_sms_number=$ALERTING_SMS_NUMBER
- $PWD/terraform apply tfplan
artifacts:
files:
- '**/*'
base-directory: website/public/