Skip to content

Commit

Permalink
modified the code and removed unneccessary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
poswalsameer committed Dec 23, 2024
2 parents 0a17ad1 + 80a80a2 commit b4f07a6
Show file tree
Hide file tree
Showing 29 changed files with 591 additions and 640 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,38 @@ on:
push:
branches:
- main
- develop
paths: ['apps/api/**', '.github/workflows/deploy-api.yml', 'package.json']

jobs:
build:
runs-on: ubuntu-latest
environment: alpha
environment: ${{ github.ref == 'refs/heads/main' && 'beta' || 'stage' }}
name: Build and push API docker image for release

steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.ACCESS_KEY }}
# aws-secret-access-key: ${{ secrets.SECRET_KEY }}
# aws-region: ap-south-1

# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
- name: Docker Login
uses: azure/docker-login@v2
with:
login-server: ${{ vars.ACR_REGISTRY_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

# - name: Build Docker image
# id: build
# env:
# ECR_REGISTRY: ${{ vars.ECR_REGISTRY }}
# ECR_REPOSITORY: ${{ vars.ECR_API_REPOSITORY }}
# run: |
# # Build a docker container and push it to ECR
# aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $ECR_REGISTRY
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/api/Dockerfile .
# echo "Pushing image to ECR..."
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6}
# echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
- name: Build Docker image
id: build
env:
ACR_REGISTRY_URL: ${{ vars.ACR_REGISTRY_URL }}
REPOSITORY_NAME: api
run: |
# Build a docker container and push it to ACR
docker build -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest -f ./apps/web/Dockerfile .
echo "Pushing image to ACR..."
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6}
echo "name=image::$ACR_REGISTRY_URL/$REPOSITORY_NAME:latest" >> $GITHUB_OUTPUT
# setup-database:
# needs: build
Expand Down
44 changes: 20 additions & 24 deletions .github/workflows/deploy-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- develop
paths:
[
'apps/platform/**',
Expand All @@ -15,37 +16,32 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: alpha
environment: ${{ github.ref == 'refs/heads/main' && 'beta' || 'stage' }}
name: Build and push Platform docker image for release

steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.ACCESS_KEY }}
# aws-secret-access-key: ${{ secrets.SECRET_KEY }}
# aws-region: ap-south-1

# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
- name: Docker Login
uses: azure/docker-login@v2
with:
login-server: ${{ vars.ACR_REGISTRY_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

# - name: Build Docker image
# id: build
# env:
# ECR_REGISTRY: ${{ vars.ECR_REGISTRY }}
# ECR_REPOSITORY: ${{ vars.ECR_PLATFORM_REPOSITORY }}
# run: |
# # Build a docker container and push it to ECR
# aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $ECR_REGISTRY
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/platform/Dockerfile .
# echo "Pushing image to ECR..."
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6}
# echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
- name: Build Docker image
id: build
env:
ACR_REGISTRY_URL: ${{ vars.ACR_REGISTRY_URL }}
REPOSITORY_NAME: platform
run: |
# Build a docker container and push it to ACR
docker build -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest -f ./apps/platform/Dockerfile .
echo "Pushing image to ACR..."
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6}
echo "name=image::$ACR_REGISTRY_URL/$REPOSITORY_NAME:latest" >> $GITHUB_OUTPUT
# deploy:
# needs: build
Expand Down
76 changes: 36 additions & 40 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,60 @@ on:
push:
branches:
- main
- develop
paths: ['apps/web/**', '.github/workflows/deploy-web.yml', 'package.json']

jobs:
build:
runs-on: ubuntu-latest
environment: alpha
environment: ${{ github.ref == 'refs/heads/main' && 'beta' || 'stage' }}
name: Build and push Web docker image for release

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
- name: Docker Login
uses: azure/docker-login@v2
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_KEY }}
aws-region: ap-south-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
login-server: ${{ vars.ACR_REGISTRY_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Build Docker image
id: build
env:
ECR_REGISTRY: ${{ vars.ECR_REGISTRY }}
ECR_REPOSITORY: ${{ vars.ECR_WEB_REPOSITORY }}
ACR_REGISTRY_URL: ${{ vars.ACR_REGISTRY_URL }}
REPOSITORY_NAME: web
run: |
# Build a docker container and push it to ECR
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $ECR_REGISTRY
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/web/Dockerfile .
echo "Pushing image to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6}
echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
# Build a docker container and push it to ACR
docker build -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest -f ./apps/web/Dockerfile .
echo "Pushing image to ACR..."
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6}
echo "name=image::$ACR_REGISTRY_URL/$REPOSITORY_NAME:latest" >> $GITHUB_OUTPUT
deploy:
needs: build
runs-on: ubuntu-latest
environment: alpha
name: Deploy Web docker image for release
# deploy:
# needs: build
# runs-on: ubuntu-latest
# environment: alpha
# name: Deploy Web docker image for release

steps:
- name: Checkout
uses: actions/checkout@v4
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_KEY }}
aws-region: ap-south-1
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.ACCESS_KEY }}
# aws-secret-access-key: ${{ secrets.SECRET_KEY }}
# aws-region: ap-south-1

- name: Force re-deploy task in service
id: force-redeploy
env:
ECS_CLUSTER: ${{ vars.ECS_CLUSTER }}
ECS_SERVICE: ${{ vars.ECS_WEB_SERVICE }}
run: |
aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment
# - name: Force re-deploy task in service
# id: force-redeploy
# env:
# ECS_CLUSTER: ${{ vars.ECS_CLUSTER }}
# ECS_SERVICE: ${{ vars.ECS_WEB_SERVICE }}
# run: |
# aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment
12 changes: 10 additions & 2 deletions .github/workflows/validate-api-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ on:
- '!develop'
- '!main'
paths:
['packages/api-client/**', '.github/workflows/validate-api-client.yml']
[
'packages/schema/**',
'packages/api-client/**',
'.github/workflows/validate-api-client.yaml'
]
pull_request:
paths:
['packages/api-client/**', '.github/workflows/validate-api-client.yml']
[
'packages/schema/**',
'packages/api-client/**',
'.github/workflows/validate-api-client.yaml'
]

jobs:
validate:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
branches:
- '!develop'
- '!main'
paths: ['apps/api/**', '.github/workflows/validate-api.yml']
paths: ['apps/api/**', '.github/workflows/validate-api.yaml']
pull_request:
paths: ['apps/api/**', '.github/workflows/validate-api.yml']
paths: ['apps/api/**', '.github/workflows/validate-api.yaml']

jobs:
validate:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/validate-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ on:
- '!main'
paths:
[
'packages/api-client/**',
'packages/secret-scan/**',
'apps/cli/**',
'.github/workflows/validate-cli.yml',
'.github/workflows/deploy-cli.yml'
'.github/workflows/validate-cli.yaml',
'.github/workflows/deploy-cli.yaml'
]
pull_request:
paths:
[
'packages/api-client/**',
'packages/secret-scan/**',
'apps/cli/**',
'.github/workflows/deploy-cli.yml',
'.github/workflows/validate-cli.yml'
'.github/workflows/deploy-cli.yaml',
'.github/workflows/validate-cli.yaml'
]

jobs:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/validate-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ on:
- '!main'
paths:
[
'packages/api-client/**',
'apps/platform/**',
'.github/workflows/validate-platform.yml',
'.github/workflows/deploy-platform.yml'
'.github/workflows/validate-platform.yaml',
'.github/workflows/deploy-platform.yaml'
]
pull_request:
paths:
[
'packages/api-client/**',
'apps/platform/**',
'.github/workflows/deploy-platform.yml',
'.github/workflows/validate-platform.yml'
'.github/workflows/deploy-platform.yaml',
'.github/workflows/validate-platform.yaml'
]

jobs:
Expand Down Expand Up @@ -58,4 +60,4 @@ jobs:
- name: Lint
run: |
pnpm run lint:platform
pnpm run lint:platform
4 changes: 2 additions & 2 deletions .github/workflows/validate-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
branches:
- '!develop'
- '!main'
paths: ['packages/schema/**', '.github/workflows/validate-schema.yml']
paths: ['packages/schema/**', '.github/workflows/validate-schema.yaml']
pull_request:
paths: ['packages/schema/**', '.github/workflows/validate-schema.yml']
paths: ['packages/schema/**', '.github/workflows/validate-schema.yaml']

jobs:
validate:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-secret-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- '!develop'
- '!main'
paths:
['packages/secret-scan/**', '.github/workflows/validate-secret-scan.yml']
['packages/secret-scan/**', '.github/workflows/validate-secret-scan.yaml']
pull_request:
paths:
['packages/secret-scan/**', '.github/workflows/validate-secret-scan.yml']
['packages/secret-scan/**', '.github/workflows/validate-secret-scan.yaml']

jobs:
validate:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
paths:
[
'apps/web/**',
'.github/workflows/validate-web.yml',
'.github/workflows/deploy-web.yml'
'.github/workflows/validate-web.yaml',
'.github/workflows/deploy-web.yaml'
]
pull_request:
paths:
[
'apps/web/**',
'.github/workflows/deploy-web.yml',
'.github/workflows/validate-web.yml'
'.github/workflows/deploy-web.yaml',
'.github/workflows/validate-web.yaml'
]

jobs:
Expand Down
11 changes: 2 additions & 9 deletions apps/platform/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ module.exports = {
},
rules: {
'import/no-extraneous-dependencies': 0,
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'space-before-function-paren': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off'
'@typescript-eslint/no-unsafe-return': 'off'
}
}
Loading

0 comments on commit b4f07a6

Please sign in to comment.