This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 262
/
circle.yml
76 lines (66 loc) · 2.83 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:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
services:
- docker
environment:
OS: "linux"
ARCH: "amd64"
GOVERSION: "1.9"
GOPATH: "$HOME/.go_workspace"
WORKDIR: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
E2E_CLEANUP: "false"
SKIP_TESTS: "docker,etcd,terraform,rackhd,ssh,flaky"
S3_MINIO: "s3bucket"
S3_BUCKET: "s3bucket/infrakit/build/linux-amd64"
S3_BUILD_RELEASE: "infrakit-$CIRCLE_BRANCH.tar.gz"
S3_BUILD_MASTER: "infrakit-master-$CIRCLE_BUILD_NUM.tar.gz"
dependencies:
pre:
# Wipe out the default go install.
- sudo rm -rf /usr/local/go
# Force the wipe out of GOPATH to make sure we're not relying on
# external dependencies.
- rm -rf "$GOPATH"
override:
# Install Go
- wget "https://storage.googleapis.com/golang/go$GOVERSION.$OS-$ARCH.tar.gz"
- sudo tar -C /usr/local -xzf "go$GOVERSION.$OS-$ARCH.tar.gz"
# Setup the GOPATH
- mkdir -p "$(dirname $WORKDIR)"
- cp -R "$HOME/$CIRCLE_PROJECT_REPONAME" "$WORKDIR"
# Install dependencies
- cd $WORKDIR && go get github.com/golang/lint/golint github.com/wfarner/blockcheck
- sudo apt-get update && sudo apt-get install -y libvirt-dev
test:
override:
- cd $WORKDIR && make ci
post:
# Report to codecov
- cd $WORKDIR && bash <(curl -s https://codecov.io/bash)
deployment:
release:
branch: /release-.*/
commands:
- make e2e-test
- docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWD
- DOCKER_PUSH=true DOCKER_TAG_LATEST=false DOCKER_TAG=$(echo $CIRCLE_BRANCH | awk -F - '{print $2}') DOCKER_BUILD_FLAGS="--rm=false" make build-docker
# Install minio.io for S3 bucket uploads
- wget https://dl.minio.io/client/mc/release/linux-amd64/mc && chmod a+x ./mc && sudo cp ./mc /usr/local/bin
- mc config host add $S3_MINIO https://s3.amazonaws.com $S3_KEY_ID $S3_SECRET_KEY S3v4
- mc policy download $S3_BUCKET
- tar cvfz ./$S3_BUILD_RELEASE -C build .
- mc cp ./$S3_BUILD_RELEASE $S3_BUCKET/
docker:
branch: master
commands:
- make e2e-test
- docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWD
- DOCKER_PUSH=true DOCKER_TAG_LATEST=true DOCKER_TAG="master-$CIRCLE_BUILD_NUM" DOCKER_BUILD_FLAGS="--rm=false" make build-docker
# Install minio.io for S3 bucket uploads
- wget https://dl.minio.io/client/mc/release/linux-amd64/mc && chmod a+x ./mc && sudo cp ./mc /usr/local/bin
- mc config host add $S3_MINIO https://s3.amazonaws.com $S3_KEY_ID $S3_SECRET_KEY S3v4
- mc policy download $S3_BUCKET
- tar cvfz ./$S3_BUILD_MASTER -C build .
- mc cp ./$S3_BUILD_MASTER $S3_BUCKET/
- mc cp ./$S3_BUILD_MASTER $S3_BUCKET/infrakit-latest.gz