File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed
Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ terraform {
44 source = " hashicorp/google"
55 version = " 5.34.0"
66 }
7- archive = {
8- source = " hashicorp/archive"
9- version = " ~> 2.2"
10- }
117 }
128}
139#
@@ -71,6 +67,7 @@ locals {
7167 function_export_csv_zip = " ${ path . module } /../../functions-python/export_csv/.dist/export_csv.zip"
7268
7369 function_tasks_executor_config = jsondecode (file (" ${ path . module } /../../functions-python/tasks_executor/function_config.json" ))
70+ function_tasks_executor_zip = " ${ path . module } /../../functions-python/tasks_executor/.dist/tasks_executor.zip"
7471}
7572
7673locals {
@@ -224,26 +221,10 @@ resource "google_storage_bucket_object" "reverse_geolocation_zip" {
224221}
225222
226223# 14. Task Executor
227- # Create zip file from source directory
228- data "archive_file" "tasks_executor_zip" {
229- type = " zip"
230- source_dir = " ${ path . module } /../../functions-python/tasks_executor"
231- output_path = " ${ path . module } /../../functions-python/tasks_executor/tasks_executor.zip"
232- excludes = [
233- " tests/**" ,
234- " **/__pycache__/**" ,
235- " **/*.pyc" ,
236- " .dist/**" ,
237- " main_local_debug.py" ,
238- " .coveragerc" ,
239- " requirements_dev.txt"
240- ]
241- }
242-
243224resource "google_storage_bucket_object" "tasks_executor_zip" {
244225 bucket = google_storage_bucket. functions_bucket . name
245- name = " task-executor-${ substr (data . archive_file . tasks_executor_zip . output_base64sha256 , 0 , 10 )} .zip"
246- source = data . archive_file . tasks_executor_zip . output_path
226+ name = " task-executor-${ substr (filebase64sha256 (local . function_tasks_executor_zip ) , 0 , 10 )} .zip"
227+ source = local . function_tasks_executor_zip
247228}
248229
249230# Secrets access
You can’t perform that action at this time.
0 commit comments