Skip to content

Commit

Permalink
Production Release of Patch issues (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik authored Jul 11, 2024
2 parents 0efdee9 + b638ae3 commit 3c8d929
Show file tree
Hide file tree
Showing 21 changed files with 4,920 additions and 7,704 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,43 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: 4.2.8

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build, tag, and push image to Github Container Registry
id: build-image

- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/api/Dockerfile .
# docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker run --network=host --name api -dit --env NODE_ENV=test --env JWT_SECRET=impler --env COOKIE_DOMAIN=impler ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:3000/v1/health-check | grep 'ok'
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host --name api -dit --env NODE_ENV=test --env JWT_SECRET=impler --env COOKIE_DOMAIN=impler ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

- name: Check application health
run: docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:3000/v1/health-check | grep 'ok'

# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
63 changes: 33 additions & 30 deletions .github/workflows/build-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,48 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build
run: pnpm run --filter @impler/embed build:prod

- name: Build, tag, and push image to Github Container Registry
id: build-image
- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f libs/embed/Dockerfile .
# docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host -dit ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Check application health
run: |
for i in {1..5}; do
if curl --output /dev/null --silent --head --fail http://localhost:4701/embed.umd.min.js; then
exit 0
fi
echo "Waiting for the application to start..."
sleep 5
done
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
43 changes: 15 additions & 28 deletions .github/workflows/build-queuemanager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,28 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-

- uses: pnpm/action-setup@v2.0.1
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build, tag, and push image to Github Container Registry
id: build-image
- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/queue-manager
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/queue-manager/Dockerfile .
# docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/queue-manager
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
31 changes: 6 additions & 25 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,6 @@ jobs:
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
Expand Down Expand Up @@ -74,6 +49,12 @@ jobs:
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
Expand Down
64 changes: 35 additions & 29 deletions .github/workflows/build-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,51 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Envsetup
- name: Envsetup
working-directory: apps/widget
run: npm run envsetup

- name: Build, tag, and push image to Github container registry
id: build-image

- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/widget/Dockerfile .
# docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host -dit ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

- name: Check application health
run: |
for i in {1..5}; do
if curl --output /dev/null --silent --head --fail http://localhost:3500; then
exit 0
fi
echo "Waiting for the application to start..."
sleep 5
done
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
1 change: 1 addition & 0 deletions .github/workflows/deploy-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [next]
types:
- closed
workflow_dispatch:

jobs:
build_api:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ export class TerminateUpload {
) {}

async execute(_uploadId: string) {
const upload = await this.uploadRepository.findOneAndUpdate(
const upload = await this.uploadRepository.findOne(
{
_id: _uploadId,
},
{
status: UploadStatusEnum.TERMINATED,
}
'status'
);
if (upload) {
await this.dalService.dropRecordCollection(_uploadId);
await this.uploadRepository.update({ _id: _uploadId }, { status: UploadStatusEnum.TERMINATED });
if ([UploadStatusEnum.MAPPED, UploadStatusEnum.REVIEWING].includes(upload.status as UploadStatusEnum)) {
await this.dalService.dropRecordCollection(_uploadId);
}
upload.status = UploadStatusEnum.TERMINATED;
}

return upload;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { IconType } from '@types';
import { IconSizes } from 'config';

export const UpgradeIcon = ({ size = 'sm', color }: IconType) => {
export const OutLinkIcon = ({ size = 'sm', color }: IconType) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={IconSizes[size]}
height={IconSizes[size]}
color={color}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
className="lucide lucide-trending-up"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="22 7 13.5 15.5 8.5 10.5 2 17" />
<polyline points="16 7 22 7 22 13" />
<path d="M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6" />
<path d="m21 3-9 9" />
<path d="M15 3h6v6" />
</svg>
);
};
Loading

0 comments on commit 3c8d929

Please sign in to comment.