From c6f42f1fea31b9ff194780e68f026ddf5ae08a8d Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Fri, 19 May 2023 17:53:00 -0500 Subject: [PATCH 01/12] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_ibhsfcuatrmpappscu.yml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/main_ibhsfcuatrmpappscu.yml diff --git a/.github/workflows/main_ibhsfcuatrmpappscu.yml b/.github/workflows/main_ibhsfcuatrmpappscu.yml new file mode 100644 index 000000000..ab500a8f8 --- /dev/null +++ b/.github/workflows/main_ibhsfcuatrmpappscu.yml @@ -0,0 +1,60 @@ +# 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 - ibhsfcuatrmpappscu + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + + - 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: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: php-app + path: . + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: php-app + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'ibhsfcuatrmpappscu' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_7CF34391CDE946778832663848ABD439 }} + package: . From e9bc3f3611c627b0f67f95246304f73a6cb705c4 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Mon, 22 May 2023 18:06:09 -0500 Subject: [PATCH 02/12] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..7dee7966f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,58 @@ +trigger: +- master + +pool: + vmImage: ubuntu-latest + +variables: + phpVersion: 8.1 + +steps: +- script: | + sudo update-alternatives --set php /usr/bin/php$(phpVersion) + sudo update-alternatives --set phar /usr/bin/phar$(phpVersion) + sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion) + sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion) + sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion) + displayName: 'Use PHP version $(phpVersion)' + +- script: composer install --no-interaction --prefer-dist + displayName: 'composer install' + +- task: NodeTool@0 + inputs: + versionSpec: '18.x' + displayName: 'Install NodeJS' + +- task: Npm@1 + inputs: + command: 'install' + workingDir: '$(Build.SourcesDirectory)' + displayName: 'npm install' + +- task: Npm@1 + inputs: + command: 'custom' + workingDir: '$(Build.SourcesDirectory)' + customCommand: 'run build' + displayName: 'npm build' + +- task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + **/** + !**/node_modules/** + !**/.git/** + !**/storage/** + TargetFolder: '$(Build.ArtifactStagingDirectory)' + CleanTargetFolder: true + OverWrite: true + displayName: 'Copy files to publish directory' + +- task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' + StoreAsTar: true \ No newline at end of file From 004f07fbe6323ab5234423333e2c08ec54e7bfe9 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Tue, 23 May 2023 16:30:29 -0500 Subject: [PATCH 03/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7dee7966f..e187caa78 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,8 @@ steps: command: 'custom' workingDir: '$(Build.SourcesDirectory)' customCommand: 'run build' - displayName: 'npm build' + verbose: 'true' + displayName: 'npm build' - task: CopyFiles@2 inputs: From d5459f2b700cd7582fd6c541b5f1505fc640e398 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Tue, 23 May 2023 16:55:48 -0500 Subject: [PATCH 04/12] Create jsconfig.json --- jsconfig.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..97921a98e --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["resources/js/*"] + } + }, + "exclude": ["node_modules", "public"] +} From a710c784716a90b6641a016368806203d3bd6e01 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Tue, 23 May 2023 17:13:01 -0500 Subject: [PATCH 05/12] cambios --- config/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.php b/config/database.php index 4d8a557d4..80d49b137 100644 --- a/config/database.php +++ b/config/database.php @@ -49,7 +49,7 @@ 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), + 'username' => env('DB_USERNAME', 'adminrmp'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', From d6a8d2c0ae17da911653f0d05b54217fae25b5a1 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 12:15:26 -0500 Subject: [PATCH 06/12] Remove the Azure App Service build and deployment workflow config --- .github/workflows/main_ibhsfcuatrmpappscu.yml | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 .github/workflows/main_ibhsfcuatrmpappscu.yml diff --git a/.github/workflows/main_ibhsfcuatrmpappscu.yml b/.github/workflows/main_ibhsfcuatrmpappscu.yml deleted file mode 100644 index ab500a8f8..000000000 --- a/.github/workflows/main_ibhsfcuatrmpappscu.yml +++ /dev/null @@ -1,60 +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 - ibhsfcuatrmpappscu - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - - - 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: Upload artifact for deployment job - uses: actions/upload-artifact@v2 - with: - name: php-app - path: . - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'Production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v2 - with: - name: php-app - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v2 - id: deploy-to-webapp - with: - app-name: 'ibhsfcuatrmpappscu' - slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_7CF34391CDE946778832663848ABD439 }} - package: . From 71c31dc4ecd783257991b84612908371b8823d4c Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 14:54:24 -0500 Subject: [PATCH 07/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e187caa78..4e9a9193e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,6 +30,15 @@ steps: workingDir: '$(Build.SourcesDirectory)' displayName: 'npm install' +- script: | + sudo npm i -g npm + sudo chown -R vsts:vsts ~/.npm + sudo chown -R vsts:vsts ~/.config + npm install + npm run prod + node -v + displayName: 'Generating build assets' + - task: Npm@1 inputs: command: 'custom' From bd48c2bd4d069bec32ea0ce8b39dd234d4ab3a7f Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 14:56:21 -0500 Subject: [PATCH 08/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4e9a9193e..b720b964a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,13 +39,13 @@ steps: node -v displayName: 'Generating build assets' -- task: Npm@1 - inputs: - command: 'custom' - workingDir: '$(Build.SourcesDirectory)' - customCommand: 'run build' - verbose: 'true' - displayName: 'npm build' +- #task: Npm@1 + #inputs: + # command: 'custom' + #workingDir: '$(Build.SourcesDirectory)' + #customCommand: 'run build' + #verbose: 'true' + #displayName: 'npm build' - task: CopyFiles@2 inputs: From 8103b9c516a78c8f9734df2d28a4b61a1135cb06 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 14:56:54 -0500 Subject: [PATCH 09/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b720b964a..4271700bb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,13 +39,7 @@ steps: node -v displayName: 'Generating build assets' -- #task: Npm@1 - #inputs: - # command: 'custom' - #workingDir: '$(Build.SourcesDirectory)' - #customCommand: 'run build' - #verbose: 'true' - #displayName: 'npm build' + - task: CopyFiles@2 inputs: From 28944b7c9dbd8f20464018b804e65b19f1212956 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 15:23:39 -0500 Subject: [PATCH 10/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4271700bb..303d0544d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ trigger: -- master +- main pool: vmImage: ubuntu-latest From de8016a2d6e6f0f04065e2bac23b6fbbecb2b3ae Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 15:25:29 -0500 Subject: [PATCH 11/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 303d0544d..459bc1a29 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,7 +39,13 @@ steps: node -v displayName: 'Generating build assets' - +- task: Npm@1 + inputs: + command: 'custom' + workingDir: '$(Build.SourcesDirectory)' + customCommand: 'run build' + verbose: 'true' + displayName: 'npm build' - task: CopyFiles@2 inputs: From 7e9741a55d07d4216386701f6cd0e26a98175b13 Mon Sep 17 00:00:00 2001 From: MelekMavi Date: Wed, 24 May 2023 15:27:01 -0500 Subject: [PATCH 12/12] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 459bc1a29..727eb1893 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,13 +39,6 @@ steps: node -v displayName: 'Generating build assets' -- task: Npm@1 - inputs: - command: 'custom' - workingDir: '$(Build.SourcesDirectory)' - customCommand: 'run build' - verbose: 'true' - displayName: 'npm build' - task: CopyFiles@2 inputs: