-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcircle.yml
47 lines (44 loc) · 1.53 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
machine:
environment:
DOCKER_IMAGE_NAME: kubeup/hostroutes
pre:
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci'
- sudo chmod 0755 /usr/bin/docker
- sudo curl -L 'https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2' | tar xvjf - --strip-components 3 -C $HOME/bin
services:
- docker
dependencies:
pre:
- docker info
override:
- mkdir -p $HOME/.go_workspace/src/kubeup.com
- ln -sf $HOME/$CIRCLE_PROJECT_REPONAME $HOME/.go_workspace/src/kubeup.com/$CIRCLE_PROJECT_REPONAME
- CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o hostroutes kubeup.com/hostroutes
- |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
fi
post:
- docker images
test:
override:
- go test kubeup.com/hostroutes
deployment:
hub_branch:
branch: master
owner: kubeup
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- docker push $DOCKER_IMAGE_NAME
hub_tag:
tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
owner: kubeup
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
docker tag "$DOCKER_IMAGE_NAME:$CIRCLE_TAG" "$DOCKER_IMAGE_NAME:latest"
fi
- docker push $DOCKER_IMAGE_NAME