Skip to content

Instantly share code, notes, and snippets.

@fabriziomoscon
Last active July 9, 2016 08:47
Show Gist options
  • Save fabriziomoscon/d952b0ee2c7a8b699586e3b9d1c2fee2 to your computer and use it in GitHub Desktop.
Save fabriziomoscon/d952b0ee2c7a8b699586e3b9d1c2fee2 to your computer and use it in GitHub Desktop.
box: golang
services:
- id: mongo:latest
build:
steps:
- wercker/setup-go-workspace:
package-dir: bitbucket.org/numberhack/api
- script:
name: add mongodb-org 3.0 repositories
code: |
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
apt-get update -y
- install-packages:
name: install mongoimport
packages: mongodb-org-tools
# Build the project
- script:
name: go build
code: |
go build ./cmd/phone
- script:
name: import fixtures
code: |
mongoimport -h $MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT -d test-numberhack -c accounts --file fixtures/accounts.json
# integration tests
- script:
name: go integration-test
code: |
./integration-test.sh
deploy:
steps:
- heroku-deploy:
key: $HEROKU_KEY
key-name: HEROKU_KEY_PAIR
user: $HEROKU_USER
app-name: $HEROKU_APP_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment