- Write a unit test
- Write an integration test
- Start building pipeline in groovy
We mount it to the local drive ~/learn/db/db-dev/
.
We set an environment variable for the password
We want to run the database in a non-standard ports 5433 (for dev) and 5434 (for stg).
docker pull postgres
docker run --rm --name pg-dev -e POSTGRES_PASSWORD=docker -d -p 5433:5432 -v $HOME/learn/db/dev:/var/lib/postgresql/data -e POSTGRES_PASSWORD=docker postgres
docker run --rm --name pg-stg -e POSTGRES_PASSWORD=docker -d -p 5434:5432 -v $HOME/learn/db/stg:/var/lib/postgresql/data -e POSTGRES_PASSWORD=docker postgres
# to log into the psql console
'/Applications/Postgres.app/Contents/Versions/9.3/bin'/psql -h localhost -p5433 -Upostgres
CREATE DATABASE persons;
\c persons
CREATE TABLE Person (id serial primary key, first_name varchar(255), last_name varchar(255));
curl -X POST -d '{"firstName": "Allison", "lastName": "DM" }' -H "Content-type: application/json" http://localhost:8080/persons
curl http://localhost:8080/persons