- Be sure to have Go (1.14+)
- Be sure to have postgres running locally
- Set up development db with
createdb slice_it_api_dev
- Run migration:
psql -U slice_it_user -d slice_it_api_dev -a -f internal/storage/migrations/schema.sql
go run cmd/server/main.go
Standard:
go test ./...
For some nice color output:
make test
Build docker image after code changes:
docker build \
--build-arg SLICE_IT_API_SERVER_PORT={server_port} \
--build-arg SLICE_IT_API_DB_HOST={host} \
--build-arg SLICE_IT_API_DB_PORT={db_port} \
--build-arg SLICE_IT_API_DB_USER={db_username} \
--build-arg SLICE_IT_API_DB_PASSWORD={db_password} \
--build-arg SLICE_IT_API_DB_NAME={db_name} \
--build-arg SLICE_IT_API_SSL_MODE={ssl_mode} \
-t bradfordhamilton/slice-it-api:latest .
Push image:
docker push bradfordhamilton/slice-it-api:latest
Then cd into build/terraform
and run the following commands.
terraform plan -out=tfplan -input=false .
terraform apply -input=false tfplan