/test

Primary LanguageGo

Test Application

Installation

Dependencies

Go version 1.9.2

Docker

https://docs.docker.com/docker-for-mac/install/

Database Migration Tool

mattes/migrate

go get -u -d github.com/mattes/migrate/cli github.com/lib/pq
go build -tags 'postgres' -o $GOPATH/bin/migrate github.com/mattes/migrate/cli

Postgres Client

brew install postgres

Go dep management

Masterminds/glide

curl https://glide.sh/get | sh

Setup

If you have multiple projects you may want to set up your Go environment

$HOME/project/go/.env

#!/usr/bin/env bash

# environment
export PATH=$(pwd)/bin:${PATH}
export GOPATH=$(pwd)

At the root of your $GOPATH

mkdir -p src/example.com
cd src/example.com
git clone https://github.com/alienspaces/test
cd test

Environment

Runtime environment variables are managed in a .env file.

cp .env.example .env
source .env

Development

Install Go package dependencies

glide install

Start services

Scripts to start and stop dependent services such as postgres database.

./dev-bin/start-services

To stop services:

./dev-bin/stop-services

Build / Run

NOTE: Services must be running

./dev-bin/build
test-api

Test

NOTE: Services must be running

./dev-bin/test