- Intstall https://ngrok.com/download
brew install libpq
&brew link --force libpq
(only for interact with AWS RDS)
docker-compose up
yarn build
yarn start
In order to test in local the webhooks with the mobile app it's useful to expose the local instance via (ngrok)[https://ngrok.com/download]
ngrok http 8080
Then in the config.ts
file update rampNetwork.kovan.webhookURL
with the ngrok url e.g. http://bae108bc8677.ngrok.io/ramp-network
This will bind the port 8080 to a public port via a proxy.
Staging
./cloud_sql_proxy -instances=casval-308710:europe-west1:db-staging=tcp:5434
Production
./cloud_sql_proxy -instances=casval-308710:europe-west1:db-prod=tcp:5435
- Open
schema.prisma
- Add the property in a model e.g
fooId
asString
in the Order entity or event a whole new entity
model Order {
fooId String
}
- Run
yarn db:migrate
this will ask for a migration name and generate all the required files - Run
yarn db:test:migrate
to apply the changes to the test database too
- Create a connection to the
Staging
Postgresql./cloud_sql_proxy -instances=casval-308710:europe-west1:db-staging=tcp:5434
- Run
yarn db:staging:migrate
- Commit and push to update the container
Install aws
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
Configure aws
aws configure --profile ci
ask for the credentials of ci
create a ECR repo (if doesn't exist)
aws ecr create-repository gas-station --profile ci
build the image
docker build -t 345106504809.dkr.ecr.eu-west-1.amazonaws.com/gas-station:latest .
push the image
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 345106504809.dkr.ecr.eu-west-1.amazonaws.com
psql --host database-stage.cpfuih3je3rv.eu-west-1.rds.amazonaws.com --port 5432 --username postgres --dbname gas-station-staging