/
.terrahub.yml
63 lines (63 loc) · 2.03 KB
/
.terrahub.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
component:
name: static_website
template:
resource:
google_storage_bucket:
static_website:
name: terrahub_123456_website
location: US
force_destroy: true
project: '${local.google_project_id}'
website:
main_page_suffix: index.html
not_found_page: /404.html
output:
id:
value: '${google_storage_bucket.static_website.id}'
thub_id:
value: '${google_storage_bucket.static_website.id}'
self_link:
value: '${google_storage_bucket.static_website.self_link}'
project:
value: '${google_storage_bucket.static_website.project}'
url:
value: '${google_storage_bucket.static_website.url}'
terraform:
backend:
local:
path: /tmp/.terrahub/local_backend/static_website/terraform.tfstate
build:
env:
variables:
THUB_ENV: dev
THUB_INDEX_FILE: www.txt
THUB_GS_PATH: 'gs://terrahub_123456_website'
THUB_ROBOTS: ../www/robots.dev.txt
THUB_BUILD_PATH: ../www/build
THUB_SOURCE_PATH: ../www/assets ../www/static/fonts ../www/static/img ../www/views
THUB_BUILD_OK: false
THUB_MAX_AGE: 600
phases:
pre_build:
commands:
- 'echo "BUILD: Running pre_build step"'
- ./scripts/download.sh $THUB_INDEX_FILE $THUB_GS_PATH/$THUB_INDEX_FILE
- ./scripts/compare.sh $THUB_INDEX_FILE $THUB_SOURCE_PATH
finally:
- 'echo "BUILD: pre_build step successful"'
build:
commands:
- 'echo "BUILD: Running build step"'
- ../www/bin/compile.sh
finally:
- 'echo "BUILD: build step successful"'
post_build:
commands:
- 'echo "BUILD: Running post_build step"'
- ./scripts/shasum.sh $THUB_BUILD_PATH/$THUB_INDEX_FILE
- >-
./scripts/upload.sh $THUB_BUILD_PATH $THUB_GS_PATH --cache-control
max-age=$THUB_MAX_AGE
- rm -f .terrahub_build.env $THUB_INDEX_FILE
finally:
- 'echo "BUILD: post_build step successful"'