From 984c135204084a9e8b9309273c012695f8d80dfb Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:37:09 +0300 Subject: [PATCH 01/16] test deploy --- src/users/controllers/user.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/users/controllers/user.controller.ts b/src/users/controllers/user.controller.ts index 9d84c83..09518e8 100644 --- a/src/users/controllers/user.controller.ts +++ b/src/users/controllers/user.controller.ts @@ -14,7 +14,7 @@ export class UserController { @ApiBearerAuth() @UseGuards(AdminRoleGuard) - @Get('list1') + @Get('list') async userList(@Query() userListDto: UserListDto) { try { return await this.userService.userDetails(userListDto); From e8c2ff9209de6bd9373a5924c98b980e5b672cae Mon Sep 17 00:00:00 2001 From: Ammar Qaffaf Date: Wed, 17 Jul 2024 04:34:11 -0400 Subject: [PATCH 02/16] fix github action for staging --- .github/workflows/main_syncrow(staging).yml | 84 +++++++++++---------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main_syncrow(staging).yml b/.github/workflows/main_syncrow(staging).yml index 92c569f..952632a 100644 --- a/.github/workflows/main_syncrow(staging).yml +++ b/.github/workflows/main_syncrow(staging).yml @@ -1,7 +1,4 @@ -# 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 container app to Azure Web App - syncrow(staging) +name: Backend deployment to Azure App Service on: push: @@ -9,43 +6,50 @@ on: - main workflow_dispatch: +env: + AZURE_WEB_APP_NAME: 'syncrow' + AZURE_WEB_APP_SLOT_NAME: 'staging' + ACR_REGISTRY: 'syncrow.azurecr.io' + IMAGE_NAME: 'backend' + IMAGE_TAG: 'latest' + jobs: - build: - runs-on: 'ubuntu-latest' - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to registry - uses: docker/login-action@v2 - with: - registry: https://syncrow.azurecr.io/ - username: ${{ secrets.AzureAppService_ContainerUsername_15b75a01524a445888d33b3385de56f4 }} - password: ${{ secrets.AzureAppService_ContainerPassword_f1031a6373bf42c19e9d10cf5b73192b }} - - - name: Build and push container image to registry - uses: docker/build-push-action@v3 - with: - push: true - tags: syncrow.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_15b75a01524a445888d33b3385de56f4 }}/backend:${{ github.sha }} - file: ./Dockerfile - - deploy: + build_and_deploy: runs-on: ubuntu-latest - needs: build - environment: - name: 'staging' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} steps: - - name: Deploy to Azure Web App - id: deploy-to-webapp - uses: azure/webapps-deploy@v2 - with: - app-name: 'syncrow' - slot-name: 'staging' - publish-profile: ${{ secrets.AzureAppService_PublishProfile_a045b3d0b9f54251b6470cab2a3f18ad }} - images: 'syncrow.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_15b75a01524a445888d33b3385de56f4 }}/backend:${{ github.sha }}' \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install dependencies and build project + run: | + npm install + npm run build + + - name: Log in to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Log in to Azure Container Registry + run: az acr login --name ${{ env.ACR_REGISTRY }} + + - name: List build output + run: ls -R dist/ + + - name: Build and push Docker image + run: | + docker build . -t ${{ env.ACR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} + docker push ${{ env.ACR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} + + - name: Set Web App with Docker container + run: | + az webapp config container set \ + --name ${{ env.AZURE_WEB_APP_NAME }} \ + --resource-group backend \ + --docker-custom-image-name ${{ env.ACR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \ + --docker-registry-server-url https://${{ env.ACR_REGISTRY }} From 2119ac395eb5ef42906854ebfb366763ab4a827f Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:46:13 +0300 Subject: [PATCH 03/16] test --- src/auth/constants/login.response.constant.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/auth/constants/login.response.constant.ts b/src/auth/constants/login.response.constant.ts index 0be9517..512f682 100644 --- a/src/auth/constants/login.response.constant.ts +++ b/src/auth/constants/login.response.constant.ts @@ -1,3 +1,4 @@ export interface ILoginResponse { access_token: string; } +//test From 19855598b7e77fef8a8017cb437a0a1728b34e70 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:59:18 +0300 Subject: [PATCH 04/16] test --- src/auth/constants/login.response.constant.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/auth/constants/login.response.constant.ts b/src/auth/constants/login.response.constant.ts index 512f682..0be9517 100644 --- a/src/auth/constants/login.response.constant.ts +++ b/src/auth/constants/login.response.constant.ts @@ -1,4 +1,3 @@ export interface ILoginResponse { access_token: string; } -//test From de2fe00dc81f9afa4c62884f07f844741bbf4aba Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:12:16 +0300 Subject: [PATCH 05/16] epmty commit From 08c0cbe405b1da2adac4b51b69b91980b1dc7cab Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:33:08 +0300 Subject: [PATCH 06/16] epmty commit From cf87388b3f3e0d94dc374dcf9b8a758c61595614 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:45:01 +0300 Subject: [PATCH 07/16] epmty commit From 5964856580df041186a1eded5949279fbeea13d1 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:23:24 +0300 Subject: [PATCH 08/16] epmty commit From 1c7a0abf298cb4b28f1750c0534fabe626958568 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:30:55 +0300 Subject: [PATCH 09/16] epmty commit From 05c1b3ab6b82525887b384c02354586970fd1d39 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:40:37 +0300 Subject: [PATCH 10/16] epmty commit From ce53bde9cf548b8de6610149697f11f9eeee854a Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:36:08 +0300 Subject: [PATCH 11/16] epmty commit From ab092b70ae1c520bf5c5e96a4961ed73a93578ff Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:52:29 +0300 Subject: [PATCH 12/16] epmty commit From af6c14520cd4e22bfc653c76a12737cee22e6957 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:56:23 +0300 Subject: [PATCH 13/16] epmty commit From 14f11f957bb6d0802a2fef44b305967ba06f9c88 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:21:06 +0300 Subject: [PATCH 14/16] epmty commit From afd1da7c51e0fbe05df6719b7c35f3e782455122 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:28:39 +0300 Subject: [PATCH 15/16] epmty commit From 578994b8562afa7e7f71f7a77c18e02a321806c6 Mon Sep 17 00:00:00 2001 From: yousef-alkhrissat Date: Wed, 31 Jul 2024 01:44:51 +0300 Subject: [PATCH 16/16] changed the name of the main module from AuthModule to AppModule --- .prettierrc | 3 ++- src/app.module.ts | 2 +- src/main.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.prettierrc b/.prettierrc index dcb7279..9d36f26 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "trailingComma": "all" + "trailingComma": "all", + "endOfLine": "auto" } \ No newline at end of file diff --git a/src/app.module.ts b/src/app.module.ts index 19cabd3..7439365 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -52,4 +52,4 @@ import { LoggingInterceptor } from './interceptors/logging.interceptor'; }, ], }) -export class AuthModule {} +export class AppModule {} diff --git a/src/main.ts b/src/main.ts index 0253ad0..e33c397 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import { NestFactory } from '@nestjs/core'; -import { AuthModule } from './app.module'; +import { AppModule } from './app.module'; import rateLimit from 'express-rate-limit'; import helmet from 'helmet'; import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.swagger.utils'; @@ -7,7 +7,7 @@ import { ValidationPipe } from '@nestjs/common'; import { SeederService } from '@app/common/seed/services/seeder.service'; async function bootstrap() { - const app = await NestFactory.create(AuthModule); + const app = await NestFactory.create(AppModule); app.enableCors();