forked from grafana/carbon-relay-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
55 lines (52 loc) · 2.57 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
machine:
environment:
GOPATH: "$HOME/go"
BASE: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME"
REPO: "$BASE/$CIRCLE_PROJECT_REPONAME"
PATH: "$PATH:$GOPATH/bin"
services:
- docker
# circleCi by default checks out the project to $HOME/carbon-relay-ng
# we need to move it to its gopath-ized location so that imports work
# we also symlink because:
# * even with our cd overrides, it starts by cd'ing into the default, showing ugly (but harmless errors)
# * it lets us just refer to things like 'build' directory which will point to the right place
checkout:
post:
- cd $HOME && mkdir -p $BASE && mv carbon-relay-ng $BASE/ && ln -s $REPO carbon-relay-ng
dependencies:
pre:
- gem install package_cloud
- gem install fpm
- sudo apt-get install rpm
- go get github.com/jteeuwen/go-bindata/...
test:
override:
- cd $REPO && go test -v -race $(go list ./... | grep -v /vendor/)
post:
- cd $REPO && make packages docker # note, this runs go-bindata again
# ideally we'd make sure that if go-bindata generated new content, we fail.
# because devs should have run go-bindata and checked in changes already.
# but because git checkout will change the timestamps and mode, it'll generate slight differences, and it's hard to filter those out
# so for now, we just let it slip and assume devs will do a good enough job maintaining the generated data
# - git diff --exit-code
- cd $REPO && make build-win
general:
artifacts:
- build
- carbon-relay-ng.exe
deployment:
production:
branch: master
commands:
# Ubuntu 14.04 (trusty), 16.04 (xenial), debian 8 (jessie), debian 9 (stretch), debian 10 (buster, testing) Centos6 and Centos7.
# (no debian 7 wheezy because that's sysvinit which we don't have packages for)
- package_cloud push ${PACKAGECLOUD_REPO}/ubuntu/trusty build/deb-upstart/carbon-relay-ng-*.deb
- package_cloud push ${PACKAGECLOUD_REPO}/ubuntu/xenial build/deb-systemd/carbon-relay-ng-*.deb
- package_cloud push ${PACKAGECLOUD_REPO}/debian/jessie build/deb-systemd/carbon-relay-ng-*.deb
- package_cloud push ${PACKAGECLOUD_REPO}/debian/stretch build/deb-systemd/carbon-relay-ng-*.deb
- package_cloud push ${PACKAGECLOUD_REPO}/debian/buster build/deb-systemd/carbon-relay-ng-*.deb
- package_cloud push ${PACKAGECLOUD_REPO}/el/6 build/centos-6/carbon-relay-ng-*.el6.*.rpm
- package_cloud push ${PACKAGECLOUD_REPO}/el/7 build/centos-7/carbon-relay-ng-*.el7.*.rpm
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_KEY
- ./deploy-docker.sh