forked from alexei-led/pumba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
60 lines (60 loc) · 2.64 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
machine:
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
- yes y | sudo add-apt-repository ppa:duggan/bats
- sudo apt-get update
- sudo apt-get install bats
services:
- docker
dependencies:
override:
# create builder image
- docker build -t pumba/builder:ci -f Build.Dockerfile .
# compile Pumba binary (linux/amd64)
- docker run -v "$PWD/.dist":/.dist pumba/builder:ci script/go_build.sh
# create Pumba Docker image too
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` -t gaiaadm/pumba .
test:
override:
# run tests for all Pumba packages (exl. vendor), calculate coverage and generate junit.xml reports
- docker run -e "COVERALLS_TOKEN=${COVERALLS_TOKEN}" -v "$PWD/.cover":/.cover pumba/builder:ci script/coverage.sh --coveralls
# run bats integration tests and produce TAP report
- PATH=.dist:$PATH bats -t tests > tests.output
post:
# copy test results
- cp .cover/*_tests.xml $CIRCLE_TEST_REPORTS
# copy integration test results
- cp tests.output $CIRCLE_TEST_REPORTS
# push coverage data to codecov
- bash <(curl -s https://codecov.io/bash)
deployment:
continuous:
branch: [develop, /feature_.*/]
commands:
# tag image with CircleCi branch and build
- docker tag gaiaadm/pumba gaiaadm/pumba:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/pumba gaiaadm/pumba:$CIRCLE_BRANCH
# deply image to DockerHub
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push gaiaadm/pumba
github:
branch: master
commands:
# tag image with CircleCi branch and build
- docker tag gaiaadm/pumba gaiaadm/pumba:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/pumba gaiaadm/pumba:$CIRCLE_BRANCH
# deploy image to DockerHub
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push gaiaadm/pumba
# cross compile Pumba for multiple platforms
- docker run -v "$PWD/.dist":/.dist pumba/builder:ci script/gox_build.sh
# publish new release to GitHub
- docker run -e "GITHUB_TOKEN=${GITHUB_TOKEN}" -v "$PWD/.dist":/.dist -v "$PWD/.git":/go/src/github.com/gaia-adm/pumba/.git pumba/builder:ci script/github_release.sh $CIRCLE_PROJECT_USERNAME $CIRCLE_PROJECT_REPONAME
notify:
webhooks:
- url: https://webhook.master.gaiahub.io/wh/5a866f9b-98c9-438d-a8d4-53cf4ae9599c/4c310c8e220ee9bead74eece42ce0e109fd3535e
- url: https://hooks.microbadger.com/images/gaiaadm/pumba/mFsG9N5E0frOdrOLTPjYKqqt-Iw=
general:
artifacts:
- .dist