Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 2.57 KB

Readme.md

File metadata and controls

44 lines (30 loc) · 2.57 KB

Deployment using CDK

Infrastructure

Project is hosted by Scaleway, provisioning is done via Terraform with CDK.

Manual operations

  • Create project on Scaleway
  • Add relevant users to the projects with full access on project resources (and secret manager)
  • Create an IAM Application with with full access on project resources (and secret manager) with credentials to use in CI / CD deployments
  • Add your domain name, and another preview domain name, and validate it using DNS
  • Change the project variables in packages/config/src/config.ts and in .env.dist to reflect your project
  • (optional) Create a Sentry project and set the DSN in your .env.dist and a secret token in your .env
  • (optional) Create a Matomo project and set the host and siteId in .env.dist
  • (optional) Create Chromatic project and set the tokens in .env.dist and .env
  • (optional) Create a Cypress cloud project and set the tokens in packages/config/src/config.ts and .env
  • Add secrets to the Secret manager (you will find them documented in .env.dist) and in ProjectStack.ts::projectStackSensitiveVariables and WebAppStack.ts::webAppStackSensitiveVariables.
  • Create terraform backend object storage bucket to be able to use cdk with name ${projectSlug}-terraform-state

Deployment

Deployment is done via CircleCI, using the configuration in .circleci/config.yml.

To enable CircleCI on your project, you need to create a project on CircleCI based on your repository.

Project Stack

Project stack will deploy only on a CI pipeline triggered manually and will provision resources shared between all services of this project.

  • First, deploy the project stack by triggering a ci workflow manually and adding the parameter "trigger_workflow" with value "project_stack_deployment"
  • Cancel other workflows until project infrastructure is deployed
  • When project infrastructure is deployed, manually validate the transactional email domain in Scaleway console to verify the domain
  • To get the grafana users passwords (generated by the provider during deployment), go to the terraform state object storage bucket (${projectSlug}-terraform-state) state file.

Web App Stack

Web App Stack will deploy on every branch and provision all resources necessary for a preview environment or production version of the app

  • Once project infrastructure is deployed, every push will trigger a web app deployment workflow !