@@ -5,27 +5,12 @@ component:
5
5
dependsOn :
6
6
- ../google_storage
7
7
template :
8
- terraform :
9
- backend :
10
- local :
11
- path : /tmp/.terrahub/local_backend/google_function/terraform.tfstate
12
- data :
13
- terraform_remote_state :
14
- storage :
15
- backend : local
16
- config :
17
- path : /tmp/.terrahub/local_backend/google_storage/terraform.tfstate
18
8
resource :
19
- google_storage_bucket_object :
20
- google_storage_object :
21
- name : demo.zip
22
- bucket : ' ${data.terraform_remote_state.storage.thub_id}'
23
- source : ./demo.zip
24
9
google_cloudfunctions_function :
25
10
google_function :
11
+ name : ' demofunction${local.project["code"]}'
26
12
depends_on :
27
13
- google_storage_bucket_object.google_storage_object
28
- name : ' demofunction${local.project["code"]}'
29
14
region : us-central1
30
15
runtime : nodejs8
31
16
description : My demo function
@@ -35,6 +20,21 @@ component:
35
20
trigger_http : true
36
21
timeout : 60
37
22
entry_point : helloGET
23
+ google_storage_bucket_object :
24
+ google_storage_object :
25
+ name : demo.zip
26
+ bucket : ' ${data.terraform_remote_state.storage.thub_id}'
27
+ source : ./demo.zip
28
+ terraform :
29
+ backend :
30
+ local :
31
+ path : /tmp/.terrahub/local_backend/google_function/terraform.tfstate
32
+ data :
33
+ terraform_remote_state :
34
+ storage :
35
+ backend : local
36
+ config :
37
+ path : /tmp/.terrahub/local_backend/google_storage/terraform.tfstate
38
38
output :
39
39
id :
40
40
value : ' ${google_cloudfunctions_function.google_function.id}'
45
45
variables :
46
46
THUB_FUNCTION_ZIP : demo.zip
47
47
THUB_FUNCTION_TXT : demo.txt
48
- THUB_COMPONENT : google_function
49
- THUB_OBJECT : google_storage_object
48
+ COMPONENT_NAME : google_function
49
+ OBJECT_NAME : google_storage_object
50
50
THUB_BUILD_PATH : ..
51
51
THUB_BUILD_OK : false
52
52
THUB_BUCKET_PATH : ' gs://terrahub_bucket_123456'
64
64
build :
65
65
commands :
66
66
- ' echo "BUILD: Running build step"'
67
- - ./scripts/build.sh $THUB_COMPONENT $THUB_OBJECT $THUB_BUCKET_KEY/
67
+ - ./scripts/build.sh $COMPONENT_NAME $OBJECT_NAME $THUB_BUCKET_KEY/
68
68
finally :
69
69
- ' echo "BUILD: build step successful"'
70
70
post_build :
0 commit comments