-
Notifications
You must be signed in to change notification settings - Fork 29
/
circle.yml
76 lines (74 loc) · 3.37 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
machine:
environment:
DOCKER_IMAGE_NAME: kubeup/archon-controller
USER: kubeup
REPO: archon
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
- GOOS=linux go build -o archon-controller kubeup.com/archon/cmd/archon-controller
- GOOS=linux go build -o archon-conf kubeup.com/archon/cmd/archon-conf
- ./archon-controller --test-run
- |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
make test-docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
make test-docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
fi
post:
- docker images
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"
github-release release --user $USER --repo $REPO --tag $CIRCLE_TAG \
--name "archon-controller $CIRCLE_TAG" --pre-release
mv archon-controller archon-controller-linux-amd64
gzip archon-controller-linux-amd64
github-release upload --user $USER --repo $REPO --tag $CIRCLE_TAG \
--name "archon-controller-$CIRCLE_TAG-linux-amd64.gz" --file archon-controller-linux-amd64.gz
fi
- |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
GOOS=darwin go build -o archon-controller-darwin-amd64 kubeup.com/archon/cmd/archon-controller
gzip archon-controller-darwin-amd64
github-release upload --user $USER --repo $REPO --tag $CIRCLE_TAG \
--name "archon-controller-$CIRCLE_TAG-darwin-amd64.gz" --file archon-controller-darwin-amd64.gz
fi
- |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
GOOS=windows GOARCH=386 go build -o archon-controller-win-x86.exe kubeup.com/archon/cmd/archon-controller
zip archon-controller-win-x86.zip archon-controller-win-x86.exe
github-release upload --user $USER --repo $REPO --tag $CIRCLE_TAG \
--name "archon-controller-$CIRCLE_TAG-win-x86.zip" --file archon-controller-win-x86.zip
fi
- |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
mv archon-conf archon-conf-linux-amd64
gzip archon-conf-linux-amd64
github-release upload --user $USER --repo $REPO --tag $CIRCLE_TAG \
--name "archon-conf-$CIRCLE_TAG-linux-amd64.gz" --file archon-conf-linux-amd64.gz
fi
- docker push $DOCKER_IMAGE_NAME