-
Notifications
You must be signed in to change notification settings - Fork 18
Development Workflow
Shivam Kumar Jha edited this page Nov 2, 2018
·
3 revisions
- Install Go 1.10 and above
- Install Git
- Install PostgreSQL
go get -u github.com/kshitij10496/hercules
-
Make sure you have
postgresql
installed in order to use the cli comandscreatedb
andpg_restore
-
We can run postgresql locally but lets use a docker version instead: (We're creating a container with the latest version of postgres, exposing the default port
5432
, with the default userpostgres
and passwordpostgres
)
docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
- Create the database
createdb herculesdb
- Restore the backup located in the project root (hercules_backup_XXXXXXXX.dump)
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d hercules_testdb ./hercules_backup_20181020.dump
- Download the dependencies (Run this command in the project root)
dep ensure
- Expose the Database connection settings in your terminal
export HERCULES_DATABASE="user=postgres password=postgres dbname=herculesdb sslmode=disable"
- Run the project and have fun
go run server.go
- Test the entire app:
go test -v ./...
- Test a particular service:
go test -v services/<name>