From 585bde7bb4568499ad6071e50312dd46ca55ab6c Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:37:14 -0600 Subject: [PATCH 01/11] Configure DB & Redis variables --- config/database.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/config/database.php b/config/database.php index 137ad18ce..18fe341f0 100644 --- a/config/database.php +++ b/config/database.php @@ -46,11 +46,11 @@ 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), + 'host' => env('AZURE_MYSQL_HOST', '127.0.0.1'), + 'port' => env('AZURE_MYSQL_PORT', '3306'), + 'database' => env('AZURE_MYSQL_DBNAME', 'forge'), + 'username' => env('AZURE_MYSQL_USERNAME', 'forge'), + 'password' => env('AZURE_MYSQL_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', @@ -130,20 +130,22 @@ 'default' => [ 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), + 'password' => env('AZURE_REDIS_PASSWORD'), + 'port' => env('AZURE_REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), + ], 'cache' => [ + 'scheme' => 'tls', 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_CACHE_DB', '1'), + 'database' => env('AZURE_REDIS_DATABASE', '1'), ], ], From ef2da4f5805d23b4b7fe14bab3030dca1782dd45 Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:38:40 -0600 Subject: [PATCH 02/11] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_myphp.yml | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/main_myphp.yml diff --git a/.github/workflows/main_myphp.yml b/.github/workflows/main_myphp.yml new file mode 100644 index 000000000..c75fc247b --- /dev/null +++ b/.github/workflows/main_myphp.yml @@ -0,0 +1,75 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy PHP app to Azure Web App - myphp + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + - name: Check if composer.json exists + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: 'composer.json' + + - name: Run composer install if composer.json exists + if: steps.check_files.outputs.files_exists == 'true' + run: composer validate --no-check-publish && composer install --prefer-dist --no-progress + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: php-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1B8BFE10874E4DBA8BB43BAF2CB6A0EE }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_970020B4BBDB448F8B6B382FA5AFB882 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_98D5CD7D18144825A33477D93B51E1B7 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'myphp' + slot-name: 'Production' + package: . + \ No newline at end of file From 83f6c967a86d0c40385ebb72719ff319c8a8de85 Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:51:27 -0600 Subject: [PATCH 03/11] Change2 --- config/database.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config/database.php b/config/database.php index 18fe341f0..0272b40e0 100644 --- a/config/database.php +++ b/config/database.php @@ -130,21 +130,20 @@ 'default' => [ 'url' => env('REDIS_URL'), - 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), - 'password' => env('AZURE_REDIS_PASSWORD'), - 'port' => env('AZURE_REDIS_PORT', '6379'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], 'cache' => [ 'scheme' => 'tls', - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), + 'password' => env('AZURE_REDIS_PASSWORD'), + 'port' => env('AZURE_REDIS_PORT', '6379'), 'database' => env('AZURE_REDIS_DATABASE', '1'), ], From d2999fb37003e7b925923da25759a997cc03223e Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:53:47 -0600 Subject: [PATCH 04/11] change --- config/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/database.php b/config/database.php index 0272b40e0..aa7fb3275 100644 --- a/config/database.php +++ b/config/database.php @@ -140,6 +140,7 @@ 'cache' => [ 'scheme' => 'tls', + 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), 'password' => env('AZURE_REDIS_PASSWORD'), From 81553ae678bb867d193e31a5ae49e412f4dbd8d2 Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:04:37 -0600 Subject: [PATCH 05/11] CHANGEAR --- config/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/database.php b/config/database.php index aa7fb3275..0272b40e0 100644 --- a/config/database.php +++ b/config/database.php @@ -140,7 +140,6 @@ 'cache' => [ 'scheme' => 'tls', - 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), 'password' => env('AZURE_REDIS_PASSWORD'), From f48ca9011ed54c902a592e05a3c7a77dcd744c8b Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:05:36 -0600 Subject: [PATCH 06/11] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_final-xyz.yml | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/main_final-xyz.yml diff --git a/.github/workflows/main_final-xyz.yml b/.github/workflows/main_final-xyz.yml new file mode 100644 index 000000000..f3b40e249 --- /dev/null +++ b/.github/workflows/main_final-xyz.yml @@ -0,0 +1,75 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy PHP app to Azure Web App - FINAL-XYZ + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Check if composer.json exists + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: 'composer.json' + + - name: Run composer install if composer.json exists + if: steps.check_files.outputs.files_exists == 'true' + run: composer validate --no-check-publish && composer install --prefer-dist --no-progress + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: php-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6575DEBC62DA4AEFA0FFED8CA37DC54B }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_026168212FA44FDFA0F2E747F57F6B8F }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_80AF4CD3430C4AAAAF4826F6F08A04D2 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'FINAL-XYZ' + slot-name: 'Production' + package: . + \ No newline at end of file From 1a0bd69da1295c8a9be712011d65d9f04deb8252 Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:10:50 -0600 Subject: [PATCH 07/11] CHANGEAR FINAL --- config/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/database.php b/config/database.php index 0272b40e0..aa7fb3275 100644 --- a/config/database.php +++ b/config/database.php @@ -140,6 +140,7 @@ 'cache' => [ 'scheme' => 'tls', + 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), 'password' => env('AZURE_REDIS_PASSWORD'), From 9f44207566816b8a788f5d2ee3ebc60de2ab998c Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:18:33 -0600 Subject: [PATCH 08/11] 1 --- config/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/database.php b/config/database.php index aa7fb3275..0272b40e0 100644 --- a/config/database.php +++ b/config/database.php @@ -140,7 +140,6 @@ 'cache' => [ 'scheme' => 'tls', - 'host' => env('AZURE_REDIS_HOST', '127.0.0.1'), 'username' => env('REDIS_USERNAME'), 'password' => env('AZURE_REDIS_PASSWORD'), From ae78e3cf623cce3d193e3f50cfed2a2cd0d8cdba Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:34:27 -0600 Subject: [PATCH 09/11] 100 --- config/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/database.php b/config/database.php index 0272b40e0..59e34f87e 100644 --- a/config/database.php +++ b/config/database.php @@ -35,6 +35,7 @@ 'connections' => [ + 'sqlite' => [ 'driver' => 'sqlite', 'url' => env('DATABASE_URL'), From 3931f1544520ad184a101b1dc7435d6c8be6fb4d Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:36:56 -0600 Subject: [PATCH 10/11] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_testweban823.yml | 75 +++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/main_testweban823.yml diff --git a/.github/workflows/main_testweban823.yml b/.github/workflows/main_testweban823.yml new file mode 100644 index 000000000..c1b461a0d --- /dev/null +++ b/.github/workflows/main_testweban823.yml @@ -0,0 +1,75 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy PHP app to Azure Web App - testweban823 + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Check if composer.json exists + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: 'composer.json' + + - name: Run composer install if composer.json exists + if: steps.check_files.outputs.files_exists == 'true' + run: composer validate --no-check-publish && composer install --prefer-dist --no-progress + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: php-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_EAFD1674D0F04F9C8ADAE9DA16ACE588 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_721D9F50A8824637BFD8A774EE35A8F2 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3165E01AB70947C9AB18CAC9CAC81C01 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'testweban823' + slot-name: 'Production' + package: . + \ No newline at end of file From 9aad9402fd4707342776cc93ff75078e0e01566f Mon Sep 17 00:00:00 2001 From: Anmol9295 <140419297+Anmol9295@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:38:48 -0600 Subject: [PATCH 11/11] Remove the Azure App Service build and deployment workflow config --- .github/workflows/main_testweban823.yml | 75 ------------------------- 1 file changed, 75 deletions(-) delete mode 100644 .github/workflows/main_testweban823.yml diff --git a/.github/workflows/main_testweban823.yml b/.github/workflows/main_testweban823.yml deleted file mode 100644 index c1b461a0d..000000000 --- a/.github/workflows/main_testweban823.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Build and deploy PHP app to Azure Web App - testweban823 - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - - - name: Check if composer.json exists - id: check_files - uses: andstor/file-existence-action@v1 - with: - files: 'composer.json' - - - name: Run composer install if composer.json exists - if: steps.check_files.outputs.files_exists == 'true' - run: composer validate --no-check-publish && composer install --prefer-dist --no-progress - - - name: Zip artifact for deployment - run: zip release.zip ./* -r - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: php-app - path: release.zip - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'Production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - permissions: - id-token: write #This is required for requesting the JWT - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: php-app - - - name: Unzip artifact for deployment - run: unzip release.zip - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_EAFD1674D0F04F9C8ADAE9DA16ACE588 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_721D9F50A8824637BFD8A774EE35A8F2 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3165E01AB70947C9AB18CAC9CAC81C01 }} - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v3 - id: deploy-to-webapp - with: - app-name: 'testweban823' - slot-name: 'Production' - package: . - \ No newline at end of file