applait / xplex-rig

Application controller plane for xplex
0 stars 0 forks source link

xplex rig

Application controller plane for xplex

What it does:

Install

In project root, run:

$ dep ensure

Compile debug builds using build.sh:

$ ./build.sh dev

Compile static binaries for release profile:

$ ./build.sh release

Compiled binaries are put in ./bin/.

Run migrations

Migrations are run using golang-migrate/migrate. ./build.sh script has a migrate command which downloads and calls the migrate CLI.

First, set the DATABASE_URL environment variable with the Postgres database URL:

export DATABASE_URL="postgres://user:name@host/db"

Then, run the migrations:

$ ./build.sh migrate up

This will install the migrate CLI if it doesn't exist in ./bin/migrate and run the up migrations.

Undo all migrations:

$ ./build.sh migrate down

Run specific number of migrations up or down, e.g. for 1 migration:

$ ./build.sh migrate up 1
$ ./build.sh migrate down 1