From 0dba62807e7ca6b5d2865d843a74605eae45ce51 Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Tue, 14 Nov 2023 13:28:23 -0600 Subject: [PATCH 1/7] test docker image --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 147fbb6..034d35f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,11 @@ jobs: cache-to: type=gha,mode=max provenance: false + - name: Test Docker Image + run: | + docker run -p 9000:8080 --rm --init ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{} + - name: Docker Build and Push uses: docker/build-push-action@v5 if: github.ref == 'refs/heads/main' && github.event_name == 'push' From d6eca5cb153410ef96bf09643083f7c389379d18 Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Tue, 14 Nov 2023 15:56:33 -0600 Subject: [PATCH 2/7] split commands in separate steps --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 034d35f..eda325d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,12 @@ jobs: cache-to: type=gha,mode=max provenance: false - - name: Test Docker Image + - name: Test Run Docker Image run: | docker run -p 9000:8080 --rm --init ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + + - name: Test Lambda Endpoint + run: | curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{} - name: Docker Build and Push From c488ca58b0049d22dde5e7245eec16ddd4390e4f Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Wed, 15 Nov 2023 13:24:40 -0600 Subject: [PATCH 3/7] try docker run action --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eda325d..7ad651a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,11 @@ jobs: cache-to: type=gha,mode=max provenance: false - - name: Test Run Docker Image - run: | - docker run -p 9000:8080 --rm --init ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + - name: Run the build process with Docker + uses: addnab/docker-run-action@v3 + with: + image: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} + options: -p 9000:8080 --rm --init - name: Test Lambda Endpoint run: | From c136dd39e909757f60ac32e9e0a2b372292c2a11 Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Wed, 15 Nov 2023 13:28:27 -0600 Subject: [PATCH 4/7] missing apostrophe --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ad651a..9b870b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: - name: Test Lambda Endpoint run: | - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{} + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - name: Docker Build and Push uses: docker/build-push-action@v5 From b34365d4729ef76a873338bcc9675138c56b5e4d Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Wed, 15 Nov 2023 13:49:39 -0600 Subject: [PATCH 5/7] docker ps -a --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b870b4..5ab62a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: - name: Test Lambda Endpoint run: | + docker ps -a curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - name: Docker Build and Push From 84c783732017043f62377becbf81b90f73b59c74 Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Wed, 15 Nov 2023 13:51:23 -0600 Subject: [PATCH 6/7] remove --rm --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ab62a5..821b944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} - options: -p 9000:8080 --rm --init + options: -p 9000:8080 --init - name: Test Lambda Endpoint run: | From 5b09fc76921b35c3e02620f3f0e154f6df7424a5 Mon Sep 17 00:00:00 2001 From: Keith Petersen Date: Wed, 15 Nov 2023 15:47:16 -0600 Subject: [PATCH 7/7] rename step --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 821b944..2651576 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: cache-to: type=gha,mode=max provenance: false - - name: Run the build process with Docker + - name: Docker Run uses: addnab/docker-run-action@v3 with: image: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}