2018-02-18 00:55:06 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-02-18 11:49:36 +00:00
|
|
|
|
2018-02-24 23:18:47 +00:00
|
|
|
test:
|
2018-02-18 00:55:06 +00:00
|
|
|
docker:
|
2018-12-10 10:32:28 +00:00
|
|
|
- image: circleci/golang:1.11
|
2018-02-18 00:55:06 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-02-28 03:02:59 +00:00
|
|
|
- run:
|
2018-12-10 10:32:28 +00:00
|
|
|
name: Install Code Climate test-reporter
|
2018-02-28 03:02:59 +00:00
|
|
|
command: |
|
2018-02-28 03:04:55 +00:00
|
|
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
|
|
chmod +x ./cc-test-reporter
|
2018-12-10 10:32:28 +00:00
|
|
|
./cc-test-reporter before-build
|
|
|
|
- run:
|
|
|
|
name: Install gometalinter
|
|
|
|
command: curl -L https://git.io/vp6lP | sudo BINDIR=/go/bin sh
|
|
|
|
- run: make deps lint test-coverage
|
2018-02-28 03:02:59 +00:00
|
|
|
- run:
|
2018-12-10 10:32:28 +00:00
|
|
|
name: Upload Code coverage
|
2018-02-28 03:02:59 +00:00
|
|
|
command: |
|
2018-12-10 10:32:28 +00:00
|
|
|
sed -i 's#github.com/hipages/php-fpm_exporter/##' .cover/cover.out
|
|
|
|
./cc-test-reporter format-coverage -t gocov .cover/cover.out
|
|
|
|
./cc-test-reporter upload-coverage
|
2018-02-18 00:55:06 +00:00
|
|
|
|
2018-12-10 10:32:28 +00:00
|
|
|
semantic-release:
|
2018-02-24 23:18:47 +00:00
|
|
|
docker:
|
2018-06-26 23:37:38 +00:00
|
|
|
- image: circleci/node:9
|
2018-02-24 23:18:47 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-06-26 23:37:38 +00:00
|
|
|
- run: yarn global add --prefer-offline --no-progress --non-interactive "semantic-release@15.5.0" "@semantic-release/exec@2.2.4"
|
|
|
|
- run: $(yarn global bin)/semantic-release
|
2018-02-24 23:18:47 +00:00
|
|
|
|
2018-02-18 11:49:36 +00:00
|
|
|
deploy:
|
|
|
|
docker:
|
2018-12-30 23:13:41 +00:00
|
|
|
- image: circleci/golang:1.11
|
2018-02-18 11:49:36 +00:00
|
|
|
steps:
|
2018-02-18 11:50:08 +00:00
|
|
|
- checkout
|
2018-06-26 23:37:38 +00:00
|
|
|
- setup_remote_docker
|
2018-02-19 02:07:35 +00:00
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-02-18 11:49:36 +00:00
|
|
|
- run: curl -sL https://git.io/goreleaser | bash
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-n-deploy:
|
|
|
|
jobs:
|
2018-02-24 23:18:47 +00:00
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-12-10 10:32:28 +00:00
|
|
|
- semantic-release:
|
2018-06-26 23:42:14 +00:00
|
|
|
requires:
|
|
|
|
- test
|
2018-06-26 23:37:38 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
2018-02-18 11:49:36 +00:00
|
|
|
- deploy:
|
|
|
|
requires:
|
2018-02-25 00:13:14 +00:00
|
|
|
- test
|
2018-02-18 11:49:36 +00:00
|
|
|
filters:
|
2018-02-18 11:57:56 +00:00
|
|
|
branches:
|
2018-02-18 11:59:58 +00:00
|
|
|
ignore: /.*/
|
2018-02-18 11:49:36 +00:00
|
|
|
tags:
|
2018-06-26 23:37:38 +00:00
|
|
|
only: /^v.*/
|