Skip to content

Commit

Permalink
changing start to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
shashitnak committed Jun 22, 2024
1 parent e2485a3 commit 62c360f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion aws/start → aws/bootstrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh -l

BOOTSTRAP_PATH
TAILCALL_PATH
14 changes: 7 additions & 7 deletions aws/tailcall.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ variable "TERRAFORM_WORKSPACE" {
type = string
}

variable "BOOTSTRAP_PATH" {
variable "TAILCALL_PATH" {
type = string
}

Expand Down Expand Up @@ -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" {
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62c360f

Please sign in to comment.