From 83ac321519e5457771d8ddace8741c1b9718d2be Mon Sep 17 00:00:00 2001 From: cp-dharti-r Date: Mon, 10 Jun 2024 16:25:50 +0530 Subject: [PATCH 1/2] Update lambda runtime for dev --- .github/workflows/deploy-backend-dev.yml | 8 ++++---- .github/workflows/deploy-backend-prod.yml | 6 +++--- blogs/go.mod | 2 +- contact/go.mod | 2 +- contribution/go.mod | 2 +- db/go.mod | 2 +- go.mod | 2 +- infrastructure/backend.yml | 2 +- jobs/go.mod | 2 +- leave/go.mod | 2 +- notification/go.mod | 2 +- post/go.mod | 2 +- sitemap/go.mod | 2 +- utils/go.mod | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy-backend-dev.yml b/.github/workflows/deploy-backend-dev.yml index 9f46526fd..acb4b1a5a 100644 --- a/.github/workflows/deploy-backend-dev.yml +++ b/.github/workflows/deploy-backend-dev.yml @@ -3,7 +3,7 @@ name: DeployBackendDev on: push: branches: - - "master" + - "update-lambda-runtime" jobs: deploy-backend-dev: @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: "^1.20" + go-version: "^1.22.3" - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -32,8 +32,8 @@ jobs: escaped_value=$(printf '%s' "$RECAPTCHA_CONFIG_JSON_BASE64" | tr -d '\n') awk -v pattern="RECAPTCHA_CONFIG_JSON_BASE64" -v replacement="$escaped_value" '{gsub(pattern, replacement)} 1' utils/helper.go > recatpcha_config_key && mv recatpcha_config_key utils/helper.go apt-get update && apt-get install -y zip - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go - zip canopas_serverless_dev_${{ github.sha }}.zip main + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bootstrap main.go + zip canopas_serverless_dev_${{ github.sha }}.zip bootstrap aws s3 cp canopas_serverless_dev_${{ github.sha }}.zip s3://canopas-lambda-handlers - name: Deploy cloudformation stack diff --git a/.github/workflows/deploy-backend-prod.yml b/.github/workflows/deploy-backend-prod.yml index e6da70be5..faee68c10 100644 --- a/.github/workflows/deploy-backend-prod.yml +++ b/.github/workflows/deploy-backend-prod.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: "^1.20" + go-version: "^1.22.3" - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -32,8 +32,8 @@ jobs: escaped_value=$(printf '%s' "$RECAPTCHA_CONFIG_JSON_BASE64" | tr -d '\n') awk -v pattern="RECAPTCHA_CONFIG_JSON_BASE64" -v replacement="$escaped_value" '{gsub(pattern, replacement)} 1' utils/helper.go > recatpcha_config_key && mv recatpcha_config_key utils/helper.go apt-get update && apt-get install -y zip - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go - zip canopas_serverless_prod_${{ github.sha }}.zip main + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bootstrap main.go + zip canopas_serverless_prod_${{ github.sha }}.zip bootstrap aws s3 cp canopas_serverless_prod_${{ github.sha }}.zip s3://canopas-lambda-handlers - name: Deploy cloudformation stack diff --git a/blogs/go.mod b/blogs/go.mod index 86386835c..c40da0b1c 100644 --- a/blogs/go.mod +++ b/blogs/go.mod @@ -1,6 +1,6 @@ module blogs -go 1.20 +go 1.22 replace db => ../db diff --git a/contact/go.mod b/contact/go.mod index db0963b90..6def1a30f 100644 --- a/contact/go.mod +++ b/contact/go.mod @@ -1,6 +1,6 @@ module contact -go 1.20 +go 1.22 replace utils => ../utils diff --git a/contribution/go.mod b/contribution/go.mod index 8fd383300..4e8112970 100644 --- a/contribution/go.mod +++ b/contribution/go.mod @@ -1,6 +1,6 @@ module contribution -go 1.20 +go 1.22 require ( github.com/gin-gonic/gin v1.9.0 diff --git a/db/go.mod b/db/go.mod index 43ee3f97a..8421267d8 100644 --- a/db/go.mod +++ b/db/go.mod @@ -1,6 +1,6 @@ module db -go 1.20 +go 1.22 require ( github.com/jmoiron/sqlx v1.3.5 diff --git a/go.mod b/go.mod index b02938fce..d641e785e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module canopas-website -go 1.21.3 +go 1.22 replace post => ./post diff --git a/infrastructure/backend.yml b/infrastructure/backend.yml index 3584a4f60..a370f3b75 100644 --- a/infrastructure/backend.yml +++ b/infrastructure/backend.yml @@ -120,7 +120,7 @@ Resources: FunctionName: Fn::Sub: ${LambdaName} Description: LambdaFunction for canopas website api - Runtime: "go1.x" + Runtime: "provided.al2023" Code: S3Bucket: Fn::Sub: ${LambdaBucket} diff --git a/jobs/go.mod b/jobs/go.mod index d834d6da6..500101aa6 100644 --- a/jobs/go.mod +++ b/jobs/go.mod @@ -1,6 +1,6 @@ module jobs -go 1.20 +go 1.22 replace utils => ../utils diff --git a/leave/go.mod b/leave/go.mod index e08f52fbd..fe85eb778 100644 --- a/leave/go.mod +++ b/leave/go.mod @@ -1,6 +1,6 @@ module leave -go 1.19 +go 1.22 replace utils => ../utils diff --git a/notification/go.mod b/notification/go.mod index 1520e9363..df1dd9f41 100644 --- a/notification/go.mod +++ b/notification/go.mod @@ -1,6 +1,6 @@ module notification -go 1.19 +go 1.22 replace utils => ../utils diff --git a/post/go.mod b/post/go.mod index 247c7966f..ed489b0b5 100644 --- a/post/go.mod +++ b/post/go.mod @@ -1,6 +1,6 @@ module post -go 1.21.3 +go 1.22 replace db => ../db diff --git a/sitemap/go.mod b/sitemap/go.mod index 7b089d713..e63596893 100644 --- a/sitemap/go.mod +++ b/sitemap/go.mod @@ -1,6 +1,6 @@ module sitemap -go 1.20 +go 1.22 replace jobs => ../jobs diff --git a/utils/go.mod b/utils/go.mod index 0347de199..b57026ad3 100644 --- a/utils/go.mod +++ b/utils/go.mod @@ -1,6 +1,6 @@ module utils -go 1.20 +go 1.22 replace db => ../db From 416f9e03beed94128c54d9a8a393a46c9c53d575 Mon Sep 17 00:00:00 2001 From: cp-dharti-r Date: Mon, 10 Jun 2024 16:30:21 +0530 Subject: [PATCH 2/2] Reset dev deployment branch to master --- .github/workflows/deploy-backend-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-backend-dev.yml b/.github/workflows/deploy-backend-dev.yml index acb4b1a5a..61c746c22 100644 --- a/.github/workflows/deploy-backend-dev.yml +++ b/.github/workflows/deploy-backend-dev.yml @@ -3,7 +3,7 @@ name: DeployBackendDev on: push: branches: - - "update-lambda-runtime" + - "master" jobs: deploy-backend-dev: