From 9183af57e7e22d3bbb19d695236a49a5c6fffe60 Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Tue, 27 Aug 2024 11:16:51 +0100 Subject: [PATCH 1/9] Dummy Deploy Job --- .github/workflows/continousint.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index f2f6b2f8..cee159ab 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -15,4 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 - run: docker build --tag todo-app:test --target test . - - run: docker run todo-app:test \ No newline at end of file + - run: docker run todo-app:test + + deploy: + name: Push to Docker Hub and Trigger App Service for Deployment + runs-on: ubuntu-latest + needs: build + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ Date: Tue, 27 Aug 2024 12:10:22 +0100 Subject: [PATCH 2/9] Adjust dummy deploy --- .github/workflows/continousint.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index cee159ab..82dd472b 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -21,8 +21,7 @@ jobs: name: Push to Docker Hub and Trigger App Service for Deployment runs-on: ubuntu-latest needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ Date: Fri, 30 Aug 2024 18:36:01 +0100 Subject: [PATCH 3/9] Docker login steps --- .github/workflows/continousint.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index 82dd472b..fb5a811d 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -25,3 +25,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: echo hello deploy + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_NASHU }} + password: ${{ secrets.DOCKER_HUB_DUPASSWORD }} \ No newline at end of file From 5f47c909b537bde7c2e8b9872a9c3f7a860fb355 Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:40:24 +0100 Subject: [PATCH 4/9] Adding Docker Build and Push --- .github/workflows/continousint.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index fb5a811d..c47abc03 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -29,4 +29,6 @@ jobs: uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_NASHU }} - password: ${{ secrets.DOCKER_HUB_DUPASSWORD }} \ No newline at end of file + password: ${{ secrets.DOCKER_HUB_DUPASSWORD }} + - run: docker build --tag nashussain76/todo-app:prod --target production . + - run: docker push nashussain76/todo-app:prod \ No newline at end of file From 309ea500844aca76e15cbc1c5ec51c83b941b2ab Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:02:45 +0100 Subject: [PATCH 5/9] Add deployment Webhook --- .github/workflows/continousint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index c47abc03..9c56edba 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -31,4 +31,5 @@ jobs: username: ${{ secrets.DOCKER_HUB_NASHU }} password: ${{ secrets.DOCKER_HUB_DUPASSWORD }} - run: docker build --tag nashussain76/todo-app:prod --target production . - - run: docker push nashussain76/todo-app:prod \ No newline at end of file + - run: docker push nashussain76/todo-app:prod + - run: curl -dH -X POST ${{ secrets.APP_SERVICE_DEPLOYMENT_WEBHOOK }} \ No newline at end of file From 93d46618e99d17cfd9e747fc193f129eb7bd10ba Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:07:10 +0100 Subject: [PATCH 6/9] Add minor update todo app title --- todo_app/templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo_app/templates/index.html b/todo_app/templates/index.html index 6ee8dd7f..25d2fabb 100644 --- a/todo_app/templates/index.html +++ b/todo_app/templates/index.html @@ -3,7 +3,7 @@ {% block content %}
-

To-Do App

+

Updated via Pipeline To-Do App

Just another to-do app.

From 2b78d3081254bc4db131c964073416944e04990b Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:09:58 +0100 Subject: [PATCH 7/9] Deployment webhook syntax adjustment --- .github/workflows/continousint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index 9c56edba..5ba7fa74 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -32,4 +32,4 @@ jobs: password: ${{ secrets.DOCKER_HUB_DUPASSWORD }} - run: docker build --tag nashussain76/todo-app:prod --target production . - run: docker push nashussain76/todo-app:prod - - run: curl -dH -X POST ${{ secrets.APP_SERVICE_DEPLOYMENT_WEBHOOK }} \ No newline at end of file + - run: curl -dH -X POST '${{ secrets.APP_SERVICE_DEPLOYMENT_WEBHOOK }}' \ No newline at end of file From c7a1d705861b03e7c62971074130fcb89127f0bf Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:28:17 +0100 Subject: [PATCH 8/9] testng deliberate failure --- .github/workflows/continousint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index 5ba7fa74..1951dccd 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -21,7 +21,7 @@ jobs: name: Push to Docker Hub and Trigger App Service for Deployment runs-on: ubuntu-latest needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/Mod9CD' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - run: echo hello deploy From 35b02c645280e40cb7875c65333cd6c60620e6af Mon Sep 17 00:00:00 2001 From: Nas <94843416+Nasirhus@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:31:06 +0100 Subject: [PATCH 9/9] reverting back to correct branch --- .github/workflows/continousint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continousint.yaml b/.github/workflows/continousint.yaml index 1951dccd..5ba7fa74 100644 --- a/.github/workflows/continousint.yaml +++ b/.github/workflows/continousint.yaml @@ -21,7 +21,7 @@ jobs: name: Push to Docker Hub and Trigger App Service for Deployment runs-on: ubuntu-latest needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/Mod9CD' }} steps: - uses: actions/checkout@v4 - run: echo hello deploy