From 45212be2a151401cf2188a07cf4e6127055020b7 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Tue, 18 Jun 2024 18:08:43 +0530 Subject: [PATCH 01/17] fixing ./ prefix in dir path --- scripts/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b7b3d38..d60aae5 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -23,7 +23,8 @@ echo "DIRS: $(ls)" mkdir -p /app cp -r ./* /app TC_CONFIG_DIR_ROOT=/app -TC_CONFIG_DIR=$(dirname $TAILCALL_CONFIG) +TC_CONFIG_DIR=$(dirname $TAILCALL_CONFIG | sed 's|^\./||') +echo $TC_CONFIG_DIR TC_CONFIG_NAME=$(basename $TAILCALL_CONFIG) EXTENSION=$(echo $TC_CONFIG_NAME | tr '.' '\n' | tail -n 1) From b57830de52ecfdac52695b0e97aaa63d985f4aa9 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Tue, 18 Jun 2024 18:17:35 +0530 Subject: [PATCH 02/17] logging bootstrap path --- scripts/entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index d60aae5..57a0c26 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -85,9 +85,11 @@ deploy() { /scripts/create-tf-zip.sh echo "List: $(find /app -type f)" setup_terraform + BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" + echo "BOOTSTRAP_PATH: $BOOTSTRAP_PATH" awk -v org="\"$TERRAFORM_ORG\"" "{sub(/var.TERRAFORM_ORG/,org)}1" /aws/tailcall.tf > /tmp/temp1.tf awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf - awk -v boot_strap_path="config/$TC_CONFIG_DIR/bootstrap" "{sub(/BOOTSTRAP_PATH/,workspace)}1" /tmp/temp2.tf > /tmp/temp3.tf + awk -v boot_strap_path="$BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,workspace)}1" /tmp/temp2.tf > /tmp/temp3.tf mv /tmp/temp3.tf tailcall.tf terraform init echo "List: $(find /app -type f)" From 1b2e296d79e01bd16ac42492b28648467b5659ef Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Tue, 18 Jun 2024 18:35:02 +0530 Subject: [PATCH 03/17] printing tf file --- scripts/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 57a0c26..dcfc58a 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -91,6 +91,7 @@ deploy() { awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf awk -v boot_strap_path="$BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,workspace)}1" /tmp/temp2.tf > /tmp/temp3.tf mv /tmp/temp3.tf tailcall.tf + echo "config: $(cat tailcall.tf)" terraform init echo "List: $(find /app -type f)" TF_LOG=DEBUG terraform apply -auto-approve From a13bba1e37f5bdc1a636cd29b2c576343b49846b Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Tue, 18 Jun 2024 20:48:00 +0530 Subject: [PATCH 04/17] fixing aws --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index dcfc58a..b24f862 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -89,7 +89,7 @@ deploy() { echo "BOOTSTRAP_PATH: $BOOTSTRAP_PATH" awk -v org="\"$TERRAFORM_ORG\"" "{sub(/var.TERRAFORM_ORG/,org)}1" /aws/tailcall.tf > /tmp/temp1.tf awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf - awk -v boot_strap_path="$BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,workspace)}1" /tmp/temp2.tf > /tmp/temp3.tf + awk -v bootstrap_path="$BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /tmp/temp2.tf > /tmp/temp3.tf mv /tmp/temp3.tf tailcall.tf echo "config: $(cat tailcall.tf)" terraform init From 7e4930e83ea8a3351205482788c47b4115e1b639 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 11:31:54 +0530 Subject: [PATCH 05/17] setting bootstrap with var, using fileset in terraform --- aws/tailcall.tf | 12 +++++++++++- scripts/entrypoint.sh | 8 +++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/aws/tailcall.tf b/aws/tailcall.tf index 0e660a3..fc843b2 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -51,6 +51,10 @@ variable "TERRAFORM_WORKSPACE" { type = string } +variable "BOOTSTRAP_PATH" { + type = string +} + provider "aws" { region = var.AWS_REGION access_key = var.AWS_ACCESS_KEY_ID @@ -90,7 +94,13 @@ data "http" "bootstrap" { resource "local_sensitive_file" "bootstrap" { content_base64 = data.http.bootstrap.response_body_base64 - filename = "BOOTSTRAP_PATH" + filename = var.BOOTSTRAP_PATH +} + +resource "local_sensitive_file" "archive_file" { + for_each = fileset(path.module, "config/**") + content_base64 = filebase64("${each.key}") + filename = "${each.key}" } resource "aws_lambda_function" "tailcall" { diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b24f862..5e4e7c5 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -39,6 +39,7 @@ export TF_VAR_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID export TF_VAR_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY export TF_VAR_TERRAFORM_ORG=$TERRAFORM_ORG export TF_VAR_TERRAFORM_WORKSPACE=$TERRAFORM_WORKSPACE +export TF_BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" export TF_TOKEN_app_terraform_io=$TERRAFORM_API_TOKEN @@ -82,15 +83,12 @@ deploy() { cp -r /app/* /aws/config cd /aws echo "List: $(find /app -type f)" - /scripts/create-tf-zip.sh +# /scripts/create-tf-zip.sh echo "List: $(find /app -type f)" setup_terraform - BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" - echo "BOOTSTRAP_PATH: $BOOTSTRAP_PATH" awk -v org="\"$TERRAFORM_ORG\"" "{sub(/var.TERRAFORM_ORG/,org)}1" /aws/tailcall.tf > /tmp/temp1.tf awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf - awk -v bootstrap_path="$BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /tmp/temp2.tf > /tmp/temp3.tf - mv /tmp/temp3.tf tailcall.tf + mv /tmp/temp2.tf tailcall.tf echo "config: $(cat tailcall.tf)" terraform init echo "List: $(find /app -type f)" From 957f84f23fbbbdfcfdb45ce241ce7ab528e3586c Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 11:40:05 +0530 Subject: [PATCH 06/17] fixing var env --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 5e4e7c5..984c7c2 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -39,7 +39,7 @@ export TF_VAR_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID export TF_VAR_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY export TF_VAR_TERRAFORM_ORG=$TERRAFORM_ORG export TF_VAR_TERRAFORM_WORKSPACE=$TERRAFORM_WORKSPACE -export TF_BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" +export TF_VAR_BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" export TF_TOKEN_app_terraform_io=$TERRAFORM_API_TOKEN From 2db02d797898eab2afa2f0dd68addaef22e6e7b9 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 11:56:00 +0530 Subject: [PATCH 07/17] adding archive file --- aws/tailcall.tf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/aws/tailcall.tf b/aws/tailcall.tf index fc843b2..3dd7c41 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -97,12 +97,22 @@ resource "local_sensitive_file" "bootstrap" { filename = var.BOOTSTRAP_PATH } -resource "local_sensitive_file" "archive_file" { +resource "local_sensitive_file" "config" { for_each = fileset(path.module, "config/**") content_base64 = filebase64("${each.key}") filename = "${each.key}" } +data "archive_file" "tailcall" { + type = "zip" + depends_on = [ + local_sensitive_file.bootstrap, + local_sensitive_file.config + ] + source_dir = "config" + output_path = "tailcall.zip" +} + resource "aws_lambda_function" "tailcall" { depends_on = [ data.archive_file.tailcall From 1f7a47ea3ec6a044fa8a1192119973fe030a42f4 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 12:29:52 +0530 Subject: [PATCH 08/17] ls recursive --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 984c7c2..90c8dae 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -19,7 +19,7 @@ get_latest_version() { curl https://api.github.com/repos/$1/$2/releases/latest -s | jq .name -r } -echo "DIRS: $(ls)" +echo "DIRS: $(ls -R)" mkdir -p /app cp -r ./* /app TC_CONFIG_DIR_ROOT=/app From 67f438635b35cfac66b67151c235ef46b557a3d9 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 12:33:24 +0530 Subject: [PATCH 09/17] ls recursive --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 90c8dae..743f4b7 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -89,7 +89,7 @@ deploy() { awk -v org="\"$TERRAFORM_ORG\"" "{sub(/var.TERRAFORM_ORG/,org)}1" /aws/tailcall.tf > /tmp/temp1.tf awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf mv /tmp/temp2.tf tailcall.tf - echo "config: $(cat tailcall.tf)" + echo "list: $(ls -R)" terraform init echo "List: $(find /app -type f)" TF_LOG=DEBUG terraform apply -auto-approve From 58d7ec8755c62a0a45fa817a4399586b0b0bc742 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Wed, 19 Jun 2024 12:41:00 +0530 Subject: [PATCH 10/17] setting handler to var.BOOTSTRAP_PATH --- aws/tailcall.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/tailcall.tf b/aws/tailcall.tf index 3dd7c41..03d1212 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -122,7 +122,7 @@ resource "aws_lambda_function" "tailcall" { function_name = var.AWS_LAMBDA_FUNCTION_NAME runtime = "provided.al2" architectures = ["x86_64"] - handler = "bootstrap" + handler = var.BOOTSTRAP_PATH filename = data.archive_file.tailcall.output_path source_code_hash = data.archive_file.tailcall.output_base64sha256 } From 0a144a2d739855a13a416e05df0bfea217055dab Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 14:40:44 +0530 Subject: [PATCH 11/17] fixing aws --- aws/start | 3 +++ aws/tailcall.tf | 10 ++++++++-- scripts/create-tf-zip.sh | 21 --------------------- scripts/entrypoint.sh | 4 ++-- 4 files changed, 13 insertions(+), 25 deletions(-) create mode 100755 aws/start delete mode 100755 scripts/create-tf-zip.sh diff --git a/aws/start b/aws/start new file mode 100755 index 0000000..f1ffead --- /dev/null +++ b/aws/start @@ -0,0 +1,3 @@ +#!/bin/sh -l + +BOOTSTRAP_PATH \ No newline at end of file diff --git a/aws/tailcall.tf b/aws/tailcall.tf index 03d1212..b76ec3a 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -92,6 +92,11 @@ data "http" "bootstrap" { url = data.github_release.tailcall.assets[index(data.github_release.tailcall.assets.*.name, "tailcall-aws-lambda-bootstrap")].browser_download_url } +resource "local_sensitive_file" "start" { + content_base64 = filebase64("aws/start") + filename = "start" +} + resource "local_sensitive_file" "bootstrap" { content_base64 = data.http.bootstrap.response_body_base64 filename = var.BOOTSTRAP_PATH @@ -107,7 +112,8 @@ data "archive_file" "tailcall" { type = "zip" depends_on = [ local_sensitive_file.bootstrap, - local_sensitive_file.config + local_sensitive_file.config, + local_sensitive_file.start ] source_dir = "config" output_path = "tailcall.zip" @@ -122,7 +128,7 @@ resource "aws_lambda_function" "tailcall" { function_name = var.AWS_LAMBDA_FUNCTION_NAME runtime = "provided.al2" architectures = ["x86_64"] - handler = var.BOOTSTRAP_PATH + handler = "start" filename = data.archive_file.tailcall.output_path source_code_hash = data.archive_file.tailcall.output_base64sha256 } diff --git a/scripts/create-tf-zip.sh b/scripts/create-tf-zip.sh deleted file mode 100755 index f52c4e3..0000000 --- a/scripts/create-tf-zip.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -l - -depends_on="[ local_sensitive_file.bootstrap,"; -for file_path in $(find config -type f); do - echo "Path: $file_path" - name=$(basename $file_path | tr '.' '_') - - resource="resource \"local_sensitive_file\" \"$name\" {\n content_base64 = filebase64(\"$file_path\") \n filename = \"$file_path\"\n }" - - printf "\n$resource\n" >> /aws/tailcall.tf - - depends_on="$depends_on local_sensitive_file.$name," - echo $resource -done -depends_on="$depends_on ]" - -archive_file="data \"archive_file\" \"tailcall\" { \n depends_on = $depends_on \n type = \"zip\" \n source_dir = \"config\" \n output_path = \"tailcall.zip\"\n }" -printf "\n$archive_file\n" >> /aws/tailcall.tf - -echo "tailcall.tf" -cat /aws/tailcall.tf diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 743f4b7..336b92e 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -81,10 +81,10 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config + awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/lambda-function > /tmp/lambda-function + mv /tmp/lambda-function /aws/lambda-function cd /aws echo "List: $(find /app -type f)" -# /scripts/create-tf-zip.sh - echo "List: $(find /app -type f)" setup_terraform awk -v org="\"$TERRAFORM_ORG\"" "{sub(/var.TERRAFORM_ORG/,org)}1" /aws/tailcall.tf > /tmp/temp1.tf awk -v workspace="\"$TERRAFORM_WORKSPACE\"" "{sub(/var.TERRAFORM_WORKSPACE/,workspace)}1" /tmp/temp1.tf > /tmp/temp2.tf From 930be098463b55723428a918daf797fd52685c4a Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 14:44:17 +0530 Subject: [PATCH 12/17] fixing start name --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 336b92e..58b2315 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -82,7 +82,7 @@ deploy() { mkdir -p /aws/config cp -r /app/* /aws/config awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/lambda-function > /tmp/lambda-function - mv /tmp/lambda-function /aws/lambda-function + mv /tmp/start /aws/start cd /aws echo "List: $(find /app -type f)" setup_terraform From 079857a3ece2382fc0f0d86760756ebafeed3929 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 14:46:11 +0530 Subject: [PATCH 13/17] fixing start name --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 58b2315..cb26262 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -81,7 +81,7 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config - awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/lambda-function > /tmp/lambda-function + awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/start > /tmp/start mv /tmp/start /aws/start cd /aws echo "List: $(find /app -type f)" From e2485a3eecd995521d78debac254132d97167b87 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 14:47:58 +0530 Subject: [PATCH 14/17] fixing start path --- aws/tailcall.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/tailcall.tf b/aws/tailcall.tf index b76ec3a..5c47fdc 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -93,7 +93,7 @@ data "http" "bootstrap" { } resource "local_sensitive_file" "start" { - content_base64 = filebase64("aws/start") + content_base64 = filebase64("start") filename = "start" } From 62c360fa41256d2f1e8d389d0d05e2036c86a53b Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 15:12:47 +0530 Subject: [PATCH 15/17] changing start to bootstrap --- aws/{start => bootstrap} | 2 +- aws/tailcall.tf | 14 +++++++------- scripts/entrypoint.sh | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) rename aws/{start => bootstrap} (50%) diff --git a/aws/start b/aws/bootstrap similarity index 50% rename from aws/start rename to aws/bootstrap index f1ffead..aadfa45 100755 --- a/aws/start +++ b/aws/bootstrap @@ -1,3 +1,3 @@ #!/bin/sh -l -BOOTSTRAP_PATH \ No newline at end of file +TAILCALL_PATH \ No newline at end of file diff --git a/aws/tailcall.tf b/aws/tailcall.tf index 5c47fdc..70da039 100644 --- a/aws/tailcall.tf +++ b/aws/tailcall.tf @@ -51,7 +51,7 @@ variable "TERRAFORM_WORKSPACE" { type = string } -variable "BOOTSTRAP_PATH" { +variable "TAILCALL_PATH" { type = string } @@ -92,14 +92,14 @@ data "http" "bootstrap" { url = data.github_release.tailcall.assets[index(data.github_release.tailcall.assets.*.name, "tailcall-aws-lambda-bootstrap")].browser_download_url } -resource "local_sensitive_file" "start" { - content_base64 = filebase64("start") - filename = "start" +resource "local_sensitive_file" "bootstrap" { + content_base64 = filebase64("bootstrap") + filename = "config/bootstrap" } -resource "local_sensitive_file" "bootstrap" { +resource "local_sensitive_file" "tailcall" { content_base64 = data.http.bootstrap.response_body_base64 - filename = var.BOOTSTRAP_PATH + filename = var.TAILCALL_PATH } resource "local_sensitive_file" "config" { @@ -113,7 +113,7 @@ data "archive_file" "tailcall" { depends_on = [ local_sensitive_file.bootstrap, local_sensitive_file.config, - local_sensitive_file.start + local_sensitive_file.tailcall ] source_dir = "config" output_path = "tailcall.zip" diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index cb26262..74cb1bd 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -39,7 +39,7 @@ export TF_VAR_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID export TF_VAR_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY export TF_VAR_TERRAFORM_ORG=$TERRAFORM_ORG export TF_VAR_TERRAFORM_WORKSPACE=$TERRAFORM_WORKSPACE -export TF_VAR_BOOTSTRAP_PATH="config/$TC_CONFIG_DIR/bootstrap" +export TF_VAR_TAILCALL_PATH="config/$TC_CONFIG_DIR/tailcall" export TF_TOKEN_app_terraform_io=$TERRAFORM_API_TOKEN @@ -81,8 +81,8 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config - awk -v bootstrap_path="$TF_VAR_BOOTSTRAP_PATH" "{sub(/BOOTSTRAP_PATH/,bootstrap_path)}1" /aws/start > /tmp/start - mv /tmp/start /aws/start + awk -v tailcall_path="$TF_VAR_TAILCALL_PATH" "{sub(/TAILCALL_PATH/,tailcall_path)}1" /aws/bootstrap > /tmp/bootstrap + mv /tmp/bootstrap /aws/bootstrap cd /aws echo "List: $(find /app -type f)" setup_terraform From e70638010bf38802ff7eb9555cab5dcad53a8d12 Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 15:32:44 +0530 Subject: [PATCH 16/17] fixing tailcall relative path --- scripts/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 74cb1bd..656f0ca 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -81,7 +81,7 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config - awk -v tailcall_path="$TF_VAR_TAILCALL_PATH" "{sub(/TAILCALL_PATH/,tailcall_path)}1" /aws/bootstrap > /tmp/bootstrap + awk -v tailcall_path="$TC_CONFIG_DIR/tailcall" "{sub(/TAILCALL_PATH/,tailcall_path)}1" /aws/bootstrap > /tmp/bootstrap mv /tmp/bootstrap /aws/bootstrap cd /aws echo "List: $(find /app -type f)" From 51fcd7533a7cd6ba1357b4cf1fbf343fd520ff7f Mon Sep 17 00:00:00 2001 From: Shashi Kant Date: Sat, 22 Jun 2024 15:43:48 +0530 Subject: [PATCH 17/17] changing bootstrap script --- aws/bootstrap | 3 ++- scripts/entrypoint.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/bootstrap b/aws/bootstrap index aadfa45..a6664aa 100755 --- a/aws/bootstrap +++ b/aws/bootstrap @@ -1,3 +1,4 @@ #!/bin/sh -l -TAILCALL_PATH \ No newline at end of file +cd CONFIG_DIR +./tailcall \ No newline at end of file diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 656f0ca..430ab63 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -81,7 +81,7 @@ deploy() { # todo: handle name collisions mkdir -p /aws/config cp -r /app/* /aws/config - awk -v tailcall_path="$TC_CONFIG_DIR/tailcall" "{sub(/TAILCALL_PATH/,tailcall_path)}1" /aws/bootstrap > /tmp/bootstrap + awk -v config_dir="$TC_CONFIG_DIR" "{sub(/CONFIG_DIR/,config_dir)}1" /aws/bootstrap > /tmp/bootstrap mv /tmp/bootstrap /aws/bootstrap cd /aws echo "List: $(find /app -type f)"