From b8b63e8c410a42cfb1b06eb2e6b2920525c970f3 Mon Sep 17 00:00:00 2001 From: timam Date: Thu, 16 May 2024 22:36:19 +0600 Subject: [PATCH] Update deployment configuration for lambda service The deployment configuration for the lambda service has been updated. The changes include modifying the Dockerfile, updating the Kubernetes YAML file with proper values, and adjusting the GitHub workflow file to replace the Docker image tag using the full Git SHA instead of the first 8 characters. --- .github/workflows/deploy.yaml | 4 ++-- demo/lambda/deployment/deploy.yaml | 26 +++++++++++++------------- demo/lambda/src/Dockerfile | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0d292c5..0ad9361 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -36,8 +36,8 @@ jobs: - name: Replace the Docker image tag with Git SHA in deploy.yaml run: | - export GIT_SHA=$(echo $GITHUB_SHA | cut -c1-8) - sed -i "s/:.*/:$GIT_SHA/" demo/lambda/deployment/deploy.yaml + GIT_SHA=$GITHUB_SHA + sed -i.bak "s#demo-awscd-2024:.*#demo-awscd-2024:$GIT_SHA#g" demo/lambda/deployment/deploy.yaml - name: Add & Commit changes uses: EndBug/add-and-commit@v9 diff --git a/demo/lambda/deployment/deploy.yaml b/demo/lambda/deployment/deploy.yaml index 11bda25..2fd77b7 100644 --- a/demo/lambda/deployment/deploy.yaml +++ b/demo/lambda/deployment/deploy.yaml @@ -1,13 +1,13 @@ -apiVersion:5c786852 -kind:5c786852 -metadata:5c786852 - name:5c786852 - annotations:5c786852 - services.k8s.aws/region:5c786852 -spec:5c786852 - name:5c786852 - packageType:5c786852 - code:5c786852 - imageURI:5c786852 - role:5c786852 - description:5c786852 \ No newline at end of file +apiVersion: lambda.services.k8s.aws/v1alpha1 +kind: Function +metadata: + name: demo-awscd-2024 + annotations: + services.k8s.aws/region: ap-southeast-1 +spec: + name: demo-awscd-2024 + packageType: Image + code: + imageURI: 590184123335.dkr.ecr.ap-southeast-1.amazonaws.com/demo-awscd-2024:02114c130a666742be52b1783899a35e70fd6d74 + role: arn:aws:iam::590184123335:role/lambda_basic_execution + description: awscd demo lambda with ack \ No newline at end of file diff --git a/demo/lambda/src/Dockerfile b/demo/lambda/src/Dockerfile index fe2ecca..a49291f 100644 --- a/demo/lambda/src/Dockerfile +++ b/demo/lambda/src/Dockerfile @@ -4,4 +4,4 @@ COPY app.js package.json ./ RUN npm install -CMD [ "app.handler" ] \ No newline at end of file +CMD [ "app.handler" ]