-
Notifications
You must be signed in to change notification settings - Fork 19
/
circle.yml
48 lines (44 loc) · 1.39 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
machine:
environment:
CHECKOUT_DIR: $HOME/$CIRCLE_PROJECT_REPONAME
GOPATH: $HOME/go
GOROOT: $HOME/golang/go
PATH: $GOROOT/bin:$GOPATH/bin:/$PATH
GH_IRON: $GOPATH/src/github.com/iron-io
GO_PROJECT: ../go/src/github.com/iron-io/$CIRCLE_PROJECT_REPONAME
services:
- docker
checkout:
post:
- mkdir -p "$GH_IRON"
- cp -R "$CHECKOUT_DIR" "$GH_IRON/$CIRCLE_PROJECT_REPONAME"
dependencies:
pre:
- wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
- mkdir -p $HOME/golang
- tar -C $HOME/golang -xvzf go1.8.3.linux-amd64.tar.gz
- go get -u github.com/golang/dep/...
override:
# this was being dumb, don't want it to auto detect we are a go repo b/c vendoring
- which go && go version
- cd $GO_PROJECT && dep ensure
test:
pre:
- dep ensure:
pwd: $GO_PROJECT
override:
- go build .:
pwd: $GO_PROJECT
deployment:
this:
branch: release
commands:
- echo $DOCKER_HUB_CREDS > $HOME/.dockercfg
- git config --global user.name "Tony Stark"
- git config --global user.email "[email protected]"
- cd $GO_PROJECT && dep ensure
- cd $GO_PROJECT && ./build-release.sh
- cd $GO_PROJECT && go build
- docker build -t iron/cli:latest $GO_PROJECT
- docker tag iron/cli:latest iron/cli:$(grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" $GO_PROJECT/install.sh)
- docker push iron/cli