From 05078e51542ebc060b559f1f956547ac27a1234f Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:39:44 +0530 Subject: [PATCH 1/7] configuring database --- config/database.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/config/database.php b/config/database.php index 137ad18ce..ea06b4b1a 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', @@ -138,12 +138,13 @@ ], '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'), - 'database' => env('REDIS_CACHE_DB', '1'), + 'password' => env('AZURE_REDIS_PASSWORD'), + 'port' => env('AZURE_REDIS_PORT', '6379'), + 'database' => env('AZURE_REDIS_DATABASE', '1'), ], ], From ed5ff55bb1eb6bdd3ea7a74d5204f44d097921e7 Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:41:47 +0530 Subject: [PATCH 2/7] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_web-tailorpos.yml | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/main_web-tailorpos.yml diff --git a/.github/workflows/main_web-tailorpos.yml b/.github/workflows/main_web-tailorpos.yml new file mode 100644 index 000000000..8db9539dc --- /dev/null +++ b/.github/workflows/main_web-tailorpos.yml @@ -0,0 +1,66 @@ +# 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 - web-tailorpos + +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@v3 + 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 }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'web-tailorpos' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_283C7ECA30284F4B8D8095DAF3323180 }} + package: . From 1085f7e3f2a836043968dc8192190acdb8ebb419 Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:58:39 +0530 Subject: [PATCH 3/7] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_web-tailorpos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_web-tailorpos.yml b/.github/workflows/main_web-tailorpos.yml index 8db9539dc..db363211d 100644 --- a/.github/workflows/main_web-tailorpos.yml +++ b/.github/workflows/main_web-tailorpos.yml @@ -62,5 +62,5 @@ jobs: with: app-name: 'web-tailorpos' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_283C7ECA30284F4B8D8095DAF3323180 }} + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_BE69BA49C4B341EDAE92FE5F56B3B8A5 }} package: . From 3ce432636fa7ea08b1d7dfdf91163a7c8bf001cc Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:13:09 +0530 Subject: [PATCH 4/7] updated databse.php --- config/database.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/database.php b/config/database.php index ea06b4b1a..71f427682 100644 --- a/config/database.php +++ b/config/database.php @@ -46,11 +46,11 @@ 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), - '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', ''), + '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', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', @@ -140,11 +140,11 @@ 'cache' => [ 'scheme' => 'tls', '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'), - 'database' => env('AZURE_REDIS_DATABASE', '1'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), ], ], From f412299c9bd1a1f2013210838bd8520c71b9cffc Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:26:54 +0530 Subject: [PATCH 5/7] userstable --- .../2014_10_12_000000_create_users_table.php | 63 ++++++++++++++----- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 444fafb7f..13fef9ea4 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,32 +1,65 @@ -id(); + // $table->string('name'); + // $table->string('email')->unique(); + // $table->timestamp('email_verified_at')->nullable(); + // $table->string('password'); + // $table->rememberToken(); + // $table->timestamps(); + // }); + // } + + /** + * Reverse the migrations. + */ + // public function down(): void + // { + // Schema::dropIfExists('users'); + // } +//}; + + +id(); + $table->increments('id'); + $table->integer('role_id')->unsigned(); $table->string('name'); - $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); + $table->string('email',50)->unique(); + $table->string('username'); $table->string('password'); + $table->boolean('active'); $table->rememberToken(); $table->timestamps(); + }); } - /** - * Reverse the migrations. - */ - public function down(): void + public function down() { Schema::dropIfExists('users'); } -}; +} From 1ca8cca52ca74e03e038ae4b28b992f66b64ad2c Mon Sep 17 00:00:00 2001 From: Harikrishna902 <46101642+Harikrishna902@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:28:30 +0530 Subject: [PATCH 6/7] updated --- .../migrations/2014_10_12_000000_create_users_table.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 13fef9ea4..b7edb1b92 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,4 +1,4 @@ - + Date: Mon, 30 Oct 2023 15:40:47 +0530 Subject: [PATCH 7/7] changed --- .../2014_10_12_000000_create_users_table.php | 64 +++++-------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index b7edb1b92..0da90f004 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,67 +1,33 @@ id(); - // $table->string('name'); - // $table->string('email')->unique(); - // $table->timestamp('email_verified_at')->nullable(); - // $table->string('password'); - // $table->rememberToken(); - // $table->timestamps(); - // }); - // } - - /** - * Reverse the migrations. - */ - // public function down(): void - // { - // Schema::dropIfExists('users'); - // } -//}; - - - - - - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Migrations\Migration; - -class CreateUserTable extends Migration -{ - - public function up() - { + public function up(): void + { Schema::dropIfExists('users'); Schema::create('users', function (Blueprint $table) { - $table->increments('id'); - $table->integer('role_id')->unsigned(); + $table->id(); $table->string('name'); - $table->string('email',50)->unique(); - $table->string('username'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); $table->string('password'); - $table->boolean('active'); $table->rememberToken(); $table->timestamps(); - }); } - public function down() + /** + * Reverse the migrations. + */ + public function down(): void { Schema::dropIfExists('users'); } -} +};