diff --git a/.deploy/api/Dockerfile b/.deploy/api/Dockerfile index e8b7fb98f8d..1e0450fe038 100644 --- a/.deploy/api/Dockerfile +++ b/.deploy/api/Dockerfile @@ -96,6 +96,8 @@ LABEL org.opencontainers.image.source https://github.com/ever-co/ever-gauzy ENV CI=true +# ENV NODE_ENV=${NODE_ENV:-production} + # Set Python interpreter for `node-gyp` to use ENV PYTHON /usr/bin/python @@ -141,11 +143,14 @@ COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugin COPY --chown=node:node decorate-angular-cli.js lerna.json package.json yarn.lock ./ -RUN yarn install --network-timeout 1000000 --frozen-lockfile && yarn cache clean +RUN yarn install --network-timeout 1000000 --frozen-lockfile # RUN apk del build-dependencies make gcc g++ python2 py2-setuptools vips-dev FROM node:18-alpine3.17 AS prodDependencies +ENV CI=true +ENV NODE_ENV=${NODE_ENV:-production} + # Set Python interpreter for `node-gyp` to use ENV PYTHON /usr/bin/python @@ -186,7 +191,7 @@ COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugin COPY --chown=node:node package.json yarn.lock ./ -RUN yarn install --network-timeout 1000000 --frozen-lockfile --production && yarn cache clean +RUN yarn install --network-timeout 1000000 --frozen-lockfile --production # RUN apk del build-dependencies make gcc g++ python2 py2-setuptools vips-dev RUN rm -r node_modules/@angular @@ -207,8 +212,13 @@ WORKDIR /srv/gauzy RUN mkdir dist +# Copy the node_modules from the dependencies stage +COPY --from=dependencies /srv/gauzy/node_modules ./node_modules + +# Copy the compiled packages from the development stage COPY --chown=node:node --from=development /srv/gauzy . +ENV CI=true ENV NODE_OPTIONS=${NODE_OPTIONS:-"--max-old-space-size=30000"} ENV NODE_ENV=${NODE_ENV:-production} ENV DEMO=${DEMO:-false} @@ -218,7 +228,7 @@ ENV IS_DOCKER=true # Temporary disable caching in NX Cloud for builds ENV NX_NO_CLOUD=true -RUN yarn build:package:api +RUN yarn build:package:api:prod RUN yarn build:api:prod:docker FROM node:18-alpine3.17 AS production @@ -247,8 +257,12 @@ RUN npm install pm2@4.5.1 -g && \ touch ormlogs.log && chown node:node ormlogs.log && chown node:node wait && \ chmod +x wait entrypoint.compose.sh entrypoint.prod.sh && chown -R node:node apps/ +# Clean up +RUN yarn cache clean + USER node:node +ENV CI=true ENV NODE_OPTIONS=${NODE_OPTIONS:-"--max-old-space-size=7000"} ENV NODE_ENV=${NODE_ENV:-production} ENV API_HOST=${API_HOST:-api} diff --git a/.github/workflows/docker-build-publish-demo.yml b/.github/workflows/docker-build-publish-demo.yml index ee0a782d6bd..9cefdf9378a 100644 --- a/.github/workflows/docker-build-publish-demo.yml +++ b/.github/workflows/docker-build-publish-demo.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Demo on: - push: - branches: [develop, temp] + push: + branches: [develop, temp] concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api-demo:latest - everco/gauzy-api-demo:latest - registry.digitalocean.com/ever/gauzy-api-demo:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest - cache-from: type=registry,ref=everco/gauzy-api-demo:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api-demo:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api-demo:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api-demo:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp-demo:latest - everco/gauzy-webapp-demo:latest - registry.digitalocean.com/ever/gauzy-webapp-demo:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest - cache-from: type=registry,ref=everco/gauzy-webapp-demo:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp-demo:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp-demo:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp-demo:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api-demo:latest + everco/gauzy-api-demo:latest + registry.digitalocean.com/ever/gauzy-api-demo:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest + cache-from: type=registry,ref=everco/gauzy-api-demo:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api-demo:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api-demo:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api-demo:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp-demo:latest + everco/gauzy-webapp-demo:latest + registry.digitalocean.com/ever/gauzy-webapp-demo:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest + cache-from: type=registry,ref=everco/gauzy-webapp-demo:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp-demo:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp-demo:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp-demo:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest diff --git a/.github/workflows/docker-build-publish-prod.yml b/.github/workflows/docker-build-publish-prod.yml index a888c10fe33..abe3fc7c905 100644 --- a/.github/workflows/docker-build-publish-prod.yml +++ b/.github/workflows/docker-build-publish-prod.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Prod on: - push: - branches: master + push: + branches: master concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api:latest - everco/gauzy-api:latest - registry.digitalocean.com/ever/gauzy-api:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest - cache-from: type=registry,ref=everco/gauzy-api:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp:latest - everco/gauzy-webapp:latest - registry.digitalocean.com/ever/gauzy-webapp:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest - cache-from: type=registry,ref=everco/gauzy-webapp:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api:latest + everco/gauzy-api:latest + registry.digitalocean.com/ever/gauzy-api:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest + cache-from: type=registry,ref=everco/gauzy-api:latest + cache-to: type=inline + build-args: | + NODE_ENV=production + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp:latest + everco/gauzy-webapp:latest + registry.digitalocean.com/ever/gauzy-webapp:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest + cache-from: type=registry,ref=everco/gauzy-webapp:latest + cache-to: type=inline + build-args: | + NODE_ENV=production + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest diff --git a/.github/workflows/docker-build-publish-stage.yml b/.github/workflows/docker-build-publish-stage.yml index dd520e2a1e6..be57f9387e4 100644 --- a/.github/workflows/docker-build-publish-stage.yml +++ b/.github/workflows/docker-build-publish-stage.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Stage on: - push: - branches: stage + push: + branches: stage concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api-stage:latest - everco/gauzy-api-stage:latest - registry.digitalocean.com/ever/gauzy-api-stage:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest - cache-from: type=registry,ref=everco/gauzy-api-stage:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api-stage:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api-stage:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api-stage:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp-stage:latest - everco/gauzy-webapp-stage:latest - registry.digitalocean.com/ever/gauzy-webapp-stage:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest - cache-from: type=registry,ref=everco/gauzy-webapp-stage:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp-stage:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp-stage:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp-stage:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api-stage:latest + everco/gauzy-api-stage:latest + registry.digitalocean.com/ever/gauzy-api-stage:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest + cache-from: type=registry,ref=everco/gauzy-api-stage:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api-stage:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api-stage:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api-stage:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp-stage:latest + everco/gauzy-webapp-stage:latest + registry.digitalocean.com/ever/gauzy-webapp-stage:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest + cache-from: type=registry,ref=everco/gauzy-webapp-stage:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp-stage:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp-stage:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp-stage:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest diff --git a/package.json b/package.json index 8d5f9b342b3..7acf575bf82 100644 --- a/package.json +++ b/package.json @@ -118,26 +118,44 @@ "start:api:desktop": "yarn ng serve api-desktop", "deploy:desktop:mac": "npm config set cache .cache && yarn electron-builder -c.electronVersion=20.2.0 build --mac --publish always --project dist/apps/desktop", "build:package:auth": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/auth build", + "build:package:auth:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/auth build", "build:package:core": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/core build", + "build:package:core:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/core build", "build:package:common": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/common build", + "build:package:common:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/common build", "build:package:common-angular": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/common-angular build", + "build:package:common-angular:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/common-angular build", "build:package:contracts": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/contracts build", + "build:package:contracts:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/contracts build", "build:package:config": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/config build", + "build:package:config:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/config build:prod", "build:package:plugin": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugin build", + "build:package:plugin:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugin build", "build:package:plugins": "yarn run build:package:plugin:integration-ai && yarn run build:package:plugin:integration-hubstaff && yarn run build:package:plugin:integration-upwork && yarn run build:package:plugin:product-reviews && yarn run build:package:plugin:integration-github && yarn run build:package:plugin:integration-jira", + "build:package:plugins:prod": "yarn run build:package:plugin:integration-ai:prod && yarn run build:package:plugin:integration-hubstaff:prod && yarn run build:package:plugin:integration-upwork:prod && yarn run build:package:plugin:product-reviews:prod && yarn run build:package:plugin:integration-github:prod && yarn run build:package:plugin:integration-jira:prod", "build:package:plugin:integration-ai": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-ai build", + "build:package:plugin:integration-ai:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-ai build", "build:package:plugin:integration-hubstaff": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-hubstaff build", + "build:package:plugin:integration-hubstaff:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-hubstaff build", "build:package:plugin:integration-upwork": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-upwork build", + "build:package:plugin:integration-upwork:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-upwork build", "build:package:plugin:integration-github": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-github build", + "build:package:plugin:integration-github:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-github build", "build:package:plugin:integration-jira": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-jira build", + "build:package:plugin:integration-jira:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-jira build", "build:package:plugin:product-reviews": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/product-reviews build", + "build:package:plugin:product-reviews:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/product-reviews build", "build:package:plugin:knowledge-base": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/knowledge-base build", + "build:package:plugin:knowledge-base:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/knowledge-base build", "build:package:plugin:changelog": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/changelog build", + "build:package:plugin:changelog:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/changelog build", "build:package:plugin:integration-wakatime": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-wakatime build", + "build:package:plugin:integration-wakatime:prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/plugins/integration-wakatime build", "build:package:all": "yarn run build:package:contracts && yarn run build:package:common && yarn run build:package:common-angular && yarn run build:package:config && yarn run build:package:plugin && yarn run build:package:plugins && yarn run build:package:auth && yarn run build:package:core && yarn run build:package:plugin:knowledge-base && yarn run build:package:plugin:changelog && yarn build:package:desktop-libs && yarn build:package:plugin:integration-wakatime && yarn build:package:desktop-ui-lib", "build:package:desktop-window": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/desktop-window build", "build:package:desktop-libs": "yarn run build:package:desktop-window && cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/desktop-libs build", "build:package:api": "yarn run build:package:contracts && yarn run build:package:common && yarn run build:package:config && yarn run build:package:plugin && yarn run build:package:plugins && yarn run build:package:auth && yarn run build:package:core && yarn run build:package:plugin:knowledge-base && yarn run build:package:plugin:changelog", + "build:package:api:prod": "yarn run build:package:contracts:prod && yarn run build:package:common:prod && yarn run build:package:config:prod && yarn run build:package:plugin:prod && yarn run build:package:plugins:prod && yarn run build:package:auth:prod && yarn run build:package:core:prod && yarn run build:package:plugin:knowledge-base:prod && yarn run build:package:plugin:changelog:prod", "build:package:gauzy": "yarn run build:package:contracts && yarn run build:package:common && yarn run build:package:common-angular && yarn run build:package:config && yarn run build:package:plugin && yarn run build:package:plugins && yarn run build:package:auth && yarn run build:package:core && yarn run build:package:plugin:knowledge-base && yarn run build:package:plugin:changelog", "build:package:desktop-ui-lib": "cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=7000 yarn --cwd ./packages/desktop-ui-lib build", "copy-files-desktop": "copyfiles -f packages/core/src/**/*.gql dist/apps/desktop/data/", diff --git a/packages/config/package.json b/packages/config/package.json index 7edcfea3cce..668e1d45e5a 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -23,6 +23,7 @@ }, "scripts": { "build": "rimraf dist && yarn run compile", + "build:prod": "node replaceEnvFiles.js && yarn build", "compile": "tsc -p tsconfig.build.json" }, "keywords": [], diff --git a/packages/config/replaceEnvFiles.js b/packages/config/replaceEnvFiles.js new file mode 100644 index 00000000000..e7d64cca701 --- /dev/null +++ b/packages/config/replaceEnvFiles.js @@ -0,0 +1,20 @@ +const fs = require('fs'); +const path = require('path'); + +function replaceFilesForProduction() { + const env = process.env.NODE_ENV || 'development'; + + console.log(`Current NODE_ENV: ${process.env.NODE_ENV}`); + + if (env === 'production') { + const sourceFile = path.join(__dirname, 'src/environments', 'environment.prod.ts'); + const targetFile = path.join(__dirname, 'src/environments', 'environment.ts'); + + fs.copyFileSync(sourceFile, targetFile); + console.log(`Replaced environment file with ${sourceFile}`); + } else { + console.log('Development build, no file replacement necessary.'); + } +} + +replaceFilesForProduction(); diff --git a/packages/core/src/bootstrap/tracer.ts b/packages/core/src/bootstrap/tracer.ts index 88ffd90db09..40b09ff3370 100644 --- a/packages/core/src/bootstrap/tracer.ts +++ b/packages/core/src/bootstrap/tracer.ts @@ -35,9 +35,16 @@ if (env.demo) { } if (process.env.CLOUD_PROVIDER) { - serviceName = serviceName + ' (' + process.env.CLOUD_PROVIDER.toUpperCase() + ')'; + const providerName = process.env.CLOUD_PROVIDER.toUpperCase(); + console.log('Tracing Cloud Provider: ' + providerName); + serviceName = serviceName + ' (' + providerName + ')'; } +console.log('Tracing Headers: ' + process.env.OTEL_EXPORTER_OTLP_HEADERS); +console.log('Tracing URL: ' + exporterOptions.url); +console.log('Tracing environment name: ' + env.envName); +console.log('Tracing service name: ' + serviceName); + const sdk = new NodeSDK({ traceExporter, instrumentations: [getNodeAutoInstrumentations()], @@ -50,6 +57,9 @@ if (process.env.OTEL_ENABLED) { // initialize the SDK and register with the OpenTelemetry API // this enables the API to record telemetry sdk.start(); + console.log('Tracing SDK Started'); +} else { + console.log('Tracing SDK Not Enabled'); } export default sdk; diff --git a/packages/core/src/jitsu-analytics/jitsu-events-subscriber.ts b/packages/core/src/jitsu-analytics/jitsu-events-subscriber.ts index 8c302d73335..d461da13adb 100644 --- a/packages/core/src/jitsu-analytics/jitsu-events-subscriber.ts +++ b/packages/core/src/jitsu-analytics/jitsu-events-subscriber.ts @@ -1,13 +1,7 @@ import { AnalyticsInterface } from '@jitsu/js'; import { Logger } from '@nestjs/common'; import * as chalk from 'chalk'; -import { - InsertEvent, - RemoveEvent, - EntitySubscriberInterface, - UpdateEvent, - EventSubscriber, -} from 'typeorm'; +import { InsertEvent, RemoveEvent, EntitySubscriberInterface, UpdateEvent, EventSubscriber } from 'typeorm'; import { environment } from '@gauzy/config'; import { createJitsu } from './jitsu-helper'; @@ -32,27 +26,16 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { host: jitsu.serverHost, writeKey: jitsu.serverWriteKey, debug: jitsu.debug, - echoEvents: jitsu.echoEvents, + echoEvents: jitsu.echoEvents }; - this.logger.log( - `JITSU Configuration`, - chalk.magenta(JSON.stringify(jitsuConfig)) - ); + this.logger.log(`JITSU Configuration`, chalk.magenta(JSON.stringify(jitsuConfig))); // Create an instance of Jitsu Analytics with configuration this.jitsuAnalytics = createJitsu(jitsuConfig); } else { - console.error( - chalk.yellow( - `Jitsu Analytics initialization failed: Missing host or writeKey.` - ) - ); + console.error(chalk.yellow(`Jitsu Analytics initialization failed: Missing host or writeKey.`)); } } catch (error) { - console.error( - chalk.red( - `Jitsu Analytics initialization failed: ${error.message}` - ) - ); + console.error(chalk.red(`Jitsu Analytics initialization failed: ${error.message}`)); } } @@ -60,15 +43,12 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * Called after entity insertion. */ async afterInsert(event: InsertEvent) { - if (this.logEnabled) - this.logger.log( - `AFTER ENTITY INSERTED: `, - JSON.stringify(event.entity) - ); + if (this.logEnabled) this.logger.log(`AFTER ENTITY INSERTED: `, JSON.stringify(event.entity)); // Track an event with Jitsu Analytics - await this.analyticsTrack('afterInsert', { - data: { ...event.entity }, + // NOTE: we do not await before we want to track events asynchronously + this.analyticsTrack('afterInsert', { + data: { ...event.entity } }); } @@ -76,15 +56,12 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * Called after entity update. */ async afterUpdate(event: UpdateEvent) { - if (this.logEnabled) - this.logger.log( - `AFTER ENTITY UPDATED: `, - JSON.stringify(event.entity) - ); + if (this.logEnabled) this.logger.log(`AFTER ENTITY UPDATED: `, JSON.stringify(event.entity)); // Track an event with Jitsu Analytics - await this.analyticsTrack('afterUpdate', { - data: { ...event.entity }, + // NOTE: we do not await before we want to track events asynchronously + this.analyticsTrack('afterUpdate', { + data: { ...event.entity } }); } @@ -92,15 +69,12 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * Called after entity removal. */ async afterRemove(event: RemoveEvent) { - if (this.logEnabled) - this.logger.log( - `AFTER ENTITY REMOVED: `, - JSON.stringify(event.entity) - ); + if (this.logEnabled) this.logger.log(`AFTER ENTITY REMOVED: `, JSON.stringify(event.entity)); // Track an event with Jitsu Analytics - await this.analyticsTrack('afterRemove', { - data: { ...event.entity }, + // NOTE: we do not await before we want to track events asynchronously + this.analyticsTrack('afterRemove', { + data: { ...event.entity } }); } @@ -110,10 +84,7 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * @param properties Additional event properties (optional). * @returns A promise that resolves when the event is tracked. */ - async analyticsTrack( - event: string, - properties?: Record | null - ): Promise { + async analyticsTrack(event: string, properties?: Record | null): Promise { // Check if this.jitsu is defined and both host and writeKey are defined if (this.jitsuAnalytics) { try { @@ -126,14 +97,9 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { const tracked = await this.trackEvent(event, properties); if (this.logEnabled) - this.logger.log( - `After Jitsu Tracked Entity Events`, - chalk.blue(JSON.stringify(tracked)) - ); + this.logger.log(`After Jitsu Tracked Entity Events`, chalk.blue(JSON.stringify(tracked))); } catch (error) { - this.logger.error( - `Error while Jitsu tracking event. Unable to track event: ${error.message}` - ); + this.logger.error(`Error while Jitsu tracking event. Unable to track event: ${error.message}`); } } } @@ -144,10 +110,7 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * @param properties Additional data or properties associated with the event. * @returns A Promise that resolves when the event is tracked. */ - async trackEvent( - event: string, - properties?: Record | null - ): Promise { + async trackEvent(event: string, properties?: Record | null): Promise { return await this.jitsuAnalytics.track(event, properties); } @@ -157,10 +120,7 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * @param traits User traits or properties to associate with the user. * @returns A Promise that resolves when the user is identified. */ - async identify( - id: string | object, - traits?: Record | null - ): Promise { + async identify(id: string | object, traits?: Record | null): Promise { return await this.jitsuAnalytics.identify(id, traits); } @@ -170,10 +130,7 @@ export class JitsuEventsSubscriber implements EntitySubscriberInterface { * @param traits Additional data or traits associated with the group. * @returns A Promise that resolves when the users are grouped. */ - async group( - id: string | object, - traits?: Record | null - ): Promise { + async group(id: string | object, traits?: Record | null): Promise { return await this.jitsuAnalytics.group(id, traits); } }