Deployments and running up

Deployments and running up

Please firstly checkout environments - https://envoytechnology.atlassian.net/wiki/spaces/~624484c08678e900705a5762/pages/6488065

 

Deployments depend of the repository and environment:

  • docs and envoy landing (FE)

  • Partner dash (FE)

  • Companies' Landing Page (FE)

  • Backend services (BE)

Docs and envoy landing

Currently they both sits within single repository lego-blocks

Docs

Start working

  1. clone the repository lego-blocks

  2. run npm run bootstrap to install all the dependencies for each app

  3. navigate to the app you want to run and run it al. to run the docs app,
    navigate to the docs app folder cd app/docs-page

    1. run npm start

Deployment

  1. push your changes to the repository

  2. go to the Github Actions tab and navigate to the

  3. click on the run workflow button and select the main branch

  4. once the deployment is complete, you can access the app at
    https://docs.envoy.is/

  5. if the changes aren't apparent immediately, you can reset AWS CouldFront
    cache with the following command aws cloudfront create-invalidation
    --distribution-id ‹dist-id> --paths "/*"

Landing

  1. to run the the landing page app, navigate to the landing page app folder cd
    app/landing-page

  2. create a new file called config.ts which contains export
    const MIXPANEL_TOKEN = "YOUR_MIXPANEL_TOKEN"; (the mix panel token can be
    replaced by any valid string if the real one isn't provided)

  3. run npm run dev

Deployment

push your changes to the repository

go to the Github Actions tab and navigate to the production/dev build

click on the run workflow button and select the main branch

once the deployment is complete, you can access the app at

if the changes aren't apparent immediately, you can reset AWS CouldFrontcache with the following command aws cloudfront create-invalidation--distribution-id ‹dist-id> --paths "/*"

Warning!

Landing page domains are configured in serverless.yml file as part of @sls-next/serverless-component@latest configuration. Any changes done by hand to CloudFront distributions will get wiped after deployment!

Partner dash

repo - link

platform dev - link

platform prod - link

Running the app locally

  • clone the repository

  • setup AWS cli with your credentials

  • run npm run repo:update to login to the private repo and install private dependencies

  • install dependencies npm install

  • setup environment variables as described in the next section

 

NEXT_PUBLIC_ENVIRONMENT="dev" ASSET_PREFIX="" # very important to set this to the host name of the app with the protocol but without a following slash EX: "http://localhost:3000" NEXT_PUBLIC_AWS_COGNITO_REGION="eu-west-2" NEXT_PUBLIC_AWS_PROJECT_REGION="eu-west-2" NEXT_PUBLIC_API_BASE_PATH="https://uwek2gofcc.execute-api.eu-west-2.amazonaws.com/dev" NEXT_PUBLIC_PREVIEW_HOST="https://preview.dev-test-landing.envoy.is/pages%22 NEXT_PUBLIC_STRIP_DEV_KEY="pk_test_51IXXmQCrOF4FaMPz1dJH2bICaI7Ym5bLW1O4hp7m5RB7ExhRBKOh0GaoPJZfXu6Z1i4yhlhQms5VTfRrTIvgKmPD0051vWsxkV" NEXT_PUBLIC_STRIP_LIVE_KEY="pk_live_51IXXmQCrOF4FaMPzufwPZLTI9sAgtT8HcCLZbynVgXftVaaNmGbWL52lQvP2Gwvik5Yo6ep3xPwhvBYEOzqhtSwW00GmGJ5a6K"

 

run npm run dev to start the app locally

 

Deployment

Deploying the landing page app to the development environment

  1. push your changes to the repository

  2. go to the Github Actions tab and navigate to the

  3. click on the run workflow button and select the main branch

  4. once the deployment is complete, you can access the app at
    https://dev.envoy.is/

 

Deploying the landing page app to the production environment

  1. push your changes to the repository

  2. go to the Github Actions tab and navigate to the

  3. click on the run workflow button and select the main branch

  4. once the deployment is complete, you can access the app at https://envoy.is/

 

Companies' Landing Page

repo - link

Running the app locally

  • clone the repository

  • setup AWS cli with your credentials

  • run npm run repo:update to login to the private repo and install private dependencies

  • install dependencies npm install

  • setup environment variables as described in the next section


API_FUNCTION_NAME="envoy-platform-api-dev-landing-props" # change to the appropriate url this one is for development API_ENDPOINT="https://uwek2gofcc.execute-api.eu-west-2.amazonaws.com/dev/landing" # change to the appropriate url this one is for development CLOUDFRONT_ALIAS="*.dev-test-landing.envoy.is" # change to the appropriate url this one is for development CLOUDFRONT_SANDBOX_ALIAS="dev-test-sandbox-landing.envoy.is" # change to the appropriate url this one is for development NEXT_PUBLIC_API_ENDPOINT="https://uwek2gofcc.execute-api.eu-west-2.amazonaws.com/dev/landing" # change to the appropriate url this one is for development NEXT_PUBLIC_MIXPANEL_TOKEN="6b1f10ff32148b2db98a00b23c2465d9" IMGIX_PATH="https://envoy-dev.imgix.net" # change to the appropriate url this one is for development S3_BUCKET="https://s3.eu-west-2.amazonaws.com/dev-envoy-assets" # change to the appropriate bucket this one is for development HOST_NAME="" # If you want to use a hash locally you have to set this to the hash you want to use but you must remember to change it every time you want to use a different company EX: "test-company-2.dev-test-landing.envoy.is"

To find the appropriate urls for the environment you want to run the app in, you can check the workflows for deployment in the ./.github/workflows folder

 

Deployment

Deploying the app to the development environment

  1. push your changes to the repository on the develop branch

  2. the app will be deployed automatically to the development environment

  3. you can follow the progress of the deployment in the Github Actions tab

  4. once the deployment is complete, you can access the app at
    https://[company name].dev-test-landing.envoy.is/[hash]

 

Deploying the app to the production environment

  1. push your changes to the repository on the production branch

  2. the app will be deployed automatically to the staging environment

  3. you can follow the progress of the deployment in the Github Actions tab

  4. once the deployment is complete, you can access the app at
    https://[company name].lp.envoy.is/[hash]

Backend services

All backend services resides in platform-back-end-monorepo. We user serverless framework to keep all deployment configuration.

repo - link

Running the app locally

Repository has README.md file that one should refer to while settings up local development.

Environments

We use prod and develop envoriments.

develop:

This is our staging/develop env. It is completely separated from production. Meaning different database, different users, domain, queues, AWS services etc. This env is mean to be place to test stuff related to ongoing development before it lands of production.

Also it is normal to develop to be broken at any time. This is playground for all things that can’t be tested locally (due to AWS emulation limitations)

prod:

This is out live/production env.

Deployment

All deployments are done via gihub actions and use Github secrets to pass all secrets via unix ENV.

Deploying the app to the develop environment

  1. push your changes to the repository on the develop branch

  2. the app will be deployed automatically to the development environment

  3. you can follow the progress of the deployment in the Github Actions tab

 

Deploying the app to the prod environment

  1. push your changes to the repository on the production branch

  2. the app will be deployed automatically to the staging environment

  3. you can follow the progress of the deployment in the Github Actions tab