Skip to content

Instantly share code, notes, and snippets.

@aheuermann
Last active November 6, 2015 00:41
Show Gist options
  • Save aheuermann/1112e527a545a9e71216 to your computer and use it in GitHub Desktop.
Save aheuermann/1112e527a545a9e71216 to your computer and use it in GitHub Desktop.
DotCi using COMPOSE_PROJECT_NAME
before: before.sh
run:
node: "grunt test"
golang: "go test -v ./..."
#Before COMPOSE_PROJECT_NAME PR
#JOB_NAME=org/project/script=node BUILD_NUMBER=8
#do some magic string manipulation to turn the above variables into the following
PROJECT=nodeorgproject8
docker-compose -p $PROJECT up database
docker-compose -p $PROJECT run --rm db_migration
docker-compose -p $PROJECT stop database
#AFTER COMPOSE_PROJECT_NAME PR
#We don't have to pass -p because it is read from env variable
docker-compose up database
docker-compose run --rm node sh -xc "grunt migrate_db"
docker-compose stop database
database:
image: postgres
node:
build .
links:
- database
golang:
build: ./go/
links:
- database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment