-
Notifications
You must be signed in to change notification settings - Fork 2
/
circle.yml
51 lines (47 loc) · 1.77 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
machine:
services:
- docker
environment:
GODIST: "go1.7.3.linux-amd64.tar.gz"
IMPORT_PATH: "$CIRCLE_PROJECT_REPONAME"
CGO_ENABLED: 0
GOPATH: /home/ubuntu/.go_workspace
DOCKER_USER: thebho
DOCKER_EMAIL: [email protected]
IMAGE: maryville/skilldirectory
TESTER_IMAGE: maryville/skilldirectory-tester
post:
- mkdir -p download
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
dependencies:
override:
- sudo add-apt-repository ppa:masterminds/glide -y
- sudo apt-get update
- sudo apt-get install glide -y
- mkdir -p "${GOPATH}/src/${IMPORT_PATH}"
- rsync -azC --delete ./ "${GOPATH}/src/${IMPORT_PATH}/"
test:
pre:
- cd "${GOPATH}/src/${IMPORT_PATH}/" && glide install
override:
- go version
##TODO Get all these modules up to snuff so we can stop whitelisting them
- cd "${GOPATH}/src/${IMPORT_PATH}/" && ./test -a --whitelist -m ./data && go build
deployment:
release:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- docker login -u "$DOCKER_USER" -p "$dockerPass" --email "$DOCKER_EMAIL"
- cd ${GOPATH}/src/${IMPORT_PATH} && export DEBUG_FLAG=false && docker build -t $DOCKER_IMAGE:$CIRCLE_TAG .
- docker push $DOCKER_IMAGE:$CIRCLE_TAG
master:
branch: master
commands:
- docker login -u "$DOCKER_USER" -p "$dockerPass" --email "$DOCKER_EMAIL"
- cd ${GOPATH}/src/${IMPORT_PATH} && export DEBUG_FLAG=false && docker build -t $IMAGE:$CIRCLE_BRANCH .
- cd postman && docker build -t $TESTER_IMAGE:$CIRCLE_BRANCH .
- docker images
- docker push $IMAGE:$CIRCLE_BRANCH
- docker push $TESTER_IMAGE:$CIRCLE_BRANCH