From 15d4227e5cc907155ffadef6b33879f66c985e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ribeiro?= Date: Fri, 2 Jun 2023 20:16:41 -0300 Subject: [PATCH 1/3] =?UTF-8?q?conex=C3=A3o=20com=20o=20banco=20de=20dado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/database.php b/config/database.php index 4d8a557d4..8c36fa737 100644 --- a/config/database.php +++ b/config/database.php @@ -45,12 +45,12 @@ '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', ''), + 'url' => env('tasklist-php-server.mysql.database.azure.com'), + 'host' => env('asklist-php-server.mysql.database.azure.com'), + 'port' => env('3306'), + 'database' => env('tasklist-php-database', 'forge'), + 'username' => env('tasklist-php-server', 'forge'), + 'password' => env('jlxprwdfel'), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', From b7ef0b8409d6524463b5092919bf2e47332674e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ribeiro?= Date: Fri, 2 Jun 2023 20:19:30 -0300 Subject: [PATCH 2/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_tasklist-php.yml | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/main_tasklist-php.yml diff --git a/.github/workflows/main_tasklist-php.yml b/.github/workflows/main_tasklist-php.yml new file mode 100644 index 000000000..62e7b51e7 --- /dev/null +++ b/.github/workflows/main_tasklist-php.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 - tasklist-php + +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: 'tasklist-php' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_789DF60671314764807F6F2FF57706FC }} + package: . From b8b69e490650cb405944791d4a7366ec36828331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ribeiro?= Date: Fri, 2 Jun 2023 20:51:57 -0300 Subject: [PATCH 3/3] Update composer.json --- composer.json | 67 ++++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/composer.json b/composer.json index 2b0c11550..90c024cad 100644 --- a/composer.json +++ b/composer.json @@ -2,61 +2,42 @@ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], + "keywords": [ + "framework", + "laravel" + ], "license": "MIT", "require": { - "php": "^7.3|^8.0", - "fruitcake/laravel-cors": "^2.0", - "guzzlehttp/guzzle": "^7.0.1", - "laravel/framework": "^8.75", - "laravel/sanctum": "^2.11", - "laravel/tinker": "^2.5" + "php": "^8.0" }, "require-dev": { - "facade/ignition": "^2.5", - "fakerphp/faker": "^1.9.1", - "laravel/sail": "^1.0.1", - "mockery/mockery": "^1.4.4", - "nunomaduro/collision": "^5.10", - "phpunit/phpunit": "^9.5.10" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "laravel": { + "dont-discover": [] + } }, "autoload": { "psr-4": { - "App\\": "app/", - "Database\\Factories\\": "database/factories/", - "Database\\Seeders\\": "database/seeders/" - } + "App\\": "app/" + }, + "classmap": [ + "database/seeds", + "database/factories" + ] }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, - "scripts": { - "post-autoload-dump": [ - "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover --ansi" - ], - "post-update-cmd": [ - "@php artisan vendor:publish --tag=laravel-assets --ansi --force" - ], - "post-root-package-install": [ - "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "@php artisan key:generate --ansi" - ] - }, - "extra": { - "laravel": { - "dont-discover": [] - } - }, - "config": { - "optimize-autoloader": true, - "preferred-install": "dist", - "sort-packages": true - }, "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "scripts": { + } }