From 1f661f5e7b2e3e19c5d2dedbe2ccdf1f9acf5007 Mon Sep 17 00:00:00 2001 From: sethreec <112038379+sethreec@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:25:37 -0700 Subject: [PATCH 1/3] Update deploy.yml port 80 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 31168c6..48c7050 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -71,7 +71,7 @@ jobs: fi - #3) Deploy to AWS + #3) Deploy to AWS - trying to build docker container to speak to port 80? deploy: runs-on: ubuntu-latest needs: [build, setupserver] From 3954533457c1e563e24cd6d706fa79736e3f468e Mon Sep 17 00:00:00 2001 From: sethreec <112038379+sethreec@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:48:28 -0700 Subject: [PATCH 2/3] Update deploy.yml added one line to see if we can verify with github actions that at least one endpoint is functional --- .github/workflows/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 48c7050..f065758 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -97,4 +97,7 @@ jobs: sudo docker run -d -e DOPPLER_TOKEN=${{ secrets.DOPPLER_TOKEN }} -p 80:8000 --name weather_planner_app ${{ env.DOCKER_IMAGE }}:latest sudo docker ps - sudo docker images \ No newline at end of file + sudo docker images + + - name: Verify Deployment + run: curl http://${{ secrets.AWS_ADDRESS }}:80/location?city=Boise \ No newline at end of file From d3ea08dc0b388a7d6e6bb6962f0dd391bab0de95 Mon Sep 17 00:00:00 2001 From: sethreec <112038379+sethreec@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:03:04 -0700 Subject: [PATCH 3/3] Update deploy.yml creates a testdeploy job --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f065758..72935ca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -88,9 +88,9 @@ jobs: sudo systemctl start docker - sudo docker stop weather_planner_app || True - sudo docker rm weather_planner_app || True - sudo docker rmi ${{ env.DOCKER_IMAGE }} || True + sudo docker stop weather_planner_app || true + sudo docker rm weather_planner_app || true + sudo docker rmi ${{ env.DOCKER_IMAGE }} || true sudo docker pull ${{ env.DOCKER_IMAGE }}:latest @@ -99,5 +99,47 @@ jobs: sudo docker ps sudo docker images - - name: Verify Deployment - run: curl http://${{ secrets.AWS_ADDRESS }}:80/location?city=Boise \ No newline at end of file + #4) Tests Deployment + testdeploy: + runs-on: ubuntu-latest + needs: deploy + environment: devtest + + steps: + + #Start by SSHing back into the AWS server and verifying that you can access the openapi schema from localhost + #This verifies that the container is running locally on the AWS server + + - name: Verify Container Running + uses: appleboy/ssh-action@v1.2.4 + with: + host: ${{ secrets.AWS_ADDRESS }} + username: ${{ secrets.AWS_USERNAME }} + key: ${{ secrets.AWS_PEM }} + script: | + sleep 10 + curl -f http://localhost/openapi.json + + #Next work through each endpoint and test each one with a single arbitrary example as if we were curling the api from the ubuntu shell + #This is not performing unit testing or showing application functionality + #This verifies that the container running on the AWS server has ports configured correctly and each endpoint can be reached from an external user without raising any HTTP errors + + - name: Testing Location Endpoint with Single Example (Boise) + run: | + sleep 10 + curl -f http://${{ secrets.AWS_ADDRESS }}/location?city=Boise + + - name: Testing Forecast Endpoint with Single Example (Denver) + run: | + sleep 10 + curl -f http://${{ secrets.AWS_ADDRESS }}/forecast?city=Denver + + - name: Testing Clothing Endpoint with Single Example (Phoenix) + run: | + sleep 10 + curl -f -X POST http://${{ secrets.AWS_ADDRESS }}/clothing -H "Content-Type: application/json" -d '{"city":"Phoenix"}' + + - name: Testing Activities Endpoint with Single Example (Washington) + run: | + sleep 10 + curl -f -X POST http://${{ secrets.AWS_ADDRESS }}/activities -H "Content-Type: application/json" -d '{"city":"Washington"}' \ No newline at end of file