From dd132bee2f637881d4ea3dccde687aa3abc77adb Mon Sep 17 00:00:00 2001 From: voynow Date: Tue, 13 Aug 2024 19:11:44 -0400 Subject: [PATCH 1/3] Attempting new build strategy --- .github/workflows/deploy.yml | 2 -- scripts/build.sh | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0da9428..baf134a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,8 +2,6 @@ name: Deploy to Lambda on: push: - branches: - - main jobs: deploy: diff --git a/scripts/build.sh b/scripts/build.sh index 30b929e..8659116 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,7 +10,4 @@ cd package || exit zip -r ../function.zip . cd .. -cp src/training_week_generation/lambda_function.py . -zip -g function.zip training_week_generation/lambda_function.py -zip -r function.zip src -x "src/training_week_generation/lambda_function.py" -rm lambda_function.py \ No newline at end of file +zip -r function.zip src \ No newline at end of file From e90ad7f0aa242f93c36a3896522e953e87733a68 Mon Sep 17 00:00:00 2001 From: voynow Date: Tue, 13 Aug 2024 19:25:21 -0400 Subject: [PATCH 2/3] tested locally fingers crossed --- scripts/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 8659116..26fd52e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,13 +1,19 @@ #!/bin/bash +# Clean up any previous builds rm -rf package rm -f function.zip +# Export dependencies and install them into the package directory poetry export -f requirements.txt --output requirements.txt --without-hashes pip install --target ./package -r requirements.txt +# Navigate to the package directory and zip its contents cd package || exit zip -r ../function.zip . cd .. -zip -r function.zip src \ No newline at end of file +# Zip the contents of the src directory directly into the function.zip +cd src || exit +zip -r ../function.zip . # Note the dot here to include the contents, not the directory itself +cd .. \ No newline at end of file From 732808c6cd79ac17f049bc52580d826cd533e02f Mon Sep 17 00:00:00 2001 From: voynow Date: Tue, 13 Aug 2024 19:29:39 -0400 Subject: [PATCH 3/3] I've found the flaw in my design, testing again --- scripts/build.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 26fd52e..1e5f005 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,19 +1,13 @@ #!/bin/bash -# Clean up any previous builds rm -rf package rm -f function.zip -# Export dependencies and install them into the package directory poetry export -f requirements.txt --output requirements.txt --without-hashes pip install --target ./package -r requirements.txt -# Navigate to the package directory and zip its contents cd package || exit zip -r ../function.zip . cd .. -# Zip the contents of the src directory directly into the function.zip -cd src || exit -zip -r ../function.zip . # Note the dot here to include the contents, not the directory itself -cd .. \ No newline at end of file +zip -r function.zip src \ No newline at end of file