AWS_ACCESS_KEY_ID
together with AWS_SECRET_ACCESS_KEY
. These can be generated from the IAM console, under security credentials. (see here for more details)npm run dev
npm i
to install required packagesnpm run dev:services
to bring up the docker containersnpm run dev
to start the serverbrew install gitguardian/tap/ggshield
.env
file# Service API key from GitGuardian account
export GITGUARDIAN_API_KEY=abc123
Notes:
Only if necessary,
$ git commit -m "commit message" -n
$ SKIP=ggshield git commit -m "commit message"
To run the E2E tests successfully, you will need to define the following environment variables:
export E2E_TEST_REPO="e2e-test-repo"
export E2E_TEST_SECRET="blahblahblah" // this should match the value of CYPRESS_COOKIE_VALUE on
// the frontend
export E2E_TEST_GH_TOKEN="" // this can be your own personal GH access token, or the token from our
// specialized E2E test user
Run the following on the release branch to tag and push changes automatically:
npm run release --isomer_update=<versionType>
where versionType corresponds to npm version types. This only works on non-Windows platforms, for Windows, modify the release script to use %npm_config_update% instead of $npm_config_update.
The following steps are needed before you can run migrations on a remote database in a private subnet of an AWS VPC.
First, ensure that you are connected to AWS VPN as only the VPN is whitelisted to use the EC2 instance1.
Next, you will require the correct environment variables and credentials.
.ssh/.env.<staging | production>
file..env
files there.isomercms-<staging | production>-bastion.pem
Next, run the following command: npm run jump:<staging | production>
. This sets up the port-forwarding service.
Finally, run the following command in a separate terminal: npm run db:migrate:<staging | production>
to run the migration.
What happens under the hood is described below: You need to set up a local port-forwarding service that forwards traffic from a specific local port, e.g. 5433, to the database via the bastion host (remember: the bastion host resides in the public subnet of the VPC and thus can be contactable from your computer).
ssh -L 5433:<DB_HOST>:5432 <SSH_USER>@<SSH_HOST> -i <PATH_TO_SSH_HOST_PEM_FILE>
DB_HOST
, SSH_USER
, SSH_HOST
, and PEM_FILE
values can be found in the CMS <ENVIRONMENT> Database
file in the Isomer - Admin
1Password vault.PEM_FILE
(the actual file) can be found in the Isomer - Admin
1Password vault as well. Download the file and save it to your computer. and update the file value for PATH_TO_SSH_HOST_PEM_FILE
.Finally, we want to run the migration script.
DB_URI
in the .env
file so that Sequelize connects to the local port-forwarding service at port 5433: postgres://<DB_USER>:<DB_PASS>@127.0.0.1:5433/<DB_NAME>
source .env
npx sequelize-cli db:migrate
1 To check whitelisted IPs in EC2 instance,
cms-bastion-<ENVIRONMENT>
, where <ENVIRONMENT>
is either staging or production. Click on the security group and then the Inbound rules tab.