2018-02-24 23:18:47 +00:00
|
|
|
defaults: &defaults
|
|
|
|
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
|
|
|
|
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:
|
|
|
|
<<: *defaults
|
2018-02-18 00:55:06 +00:00
|
|
|
docker:
|
2018-02-28 03:02:59 +00:00
|
|
|
- image: circleci/golang:1.10
|
2018-02-18 00:55:06 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-02-28 03:02:59 +00:00
|
|
|
- run:
|
|
|
|
name: Setup Code Climate test-reporter
|
|
|
|
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-02-18 11:49:36 +00:00
|
|
|
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep
|
|
|
|
- run: dep ensure -vendor-only
|
2018-06-26 23:37:38 +00:00
|
|
|
- run: curl -L -s https://github.com/alecthomas/gometalinter/releases/download/v2.0.5/gometalinter-2.0.5-linux-amd64.tar.gz | tar xvfz - -C /go/bin/ --strip 1
|
|
|
|
- run: gometalinter --disable-all --enable=megacheck --enable=golint --enable=unconvert --enable=vet --enable=vetshadow --vendor ./...
|
2018-02-28 03:02:59 +00:00
|
|
|
- run:
|
|
|
|
name: Run tests
|
|
|
|
command: |
|
2018-06-26 23:37:38 +00:00
|
|
|
CC_TEST_REPORTER_ID=5a29fe5d2c613af8a8a4f41f8e3a0a0d74895ecc6dc5deb84664ad46a48d1ce6 ./cc-test-reporter before-build
|
2018-02-28 03:02:59 +00:00
|
|
|
go test -v -coverprofile=c.out ./...
|
2018-03-17 04:45:55 +00:00
|
|
|
CC_TEST_REPORTER_ID=5a29fe5d2c613af8a8a4f41f8e3a0a0d74895ecc6dc5deb84664ad46a48d1ce6 ./cc-test-reporter after-build --exit-code $?
|
2018-02-18 00:55:06 +00:00
|
|
|
|
2018-06-26 23:37:38 +00:00
|
|
|
release:
|
2018-02-24 23:18:47 +00:00
|
|
|
<<: *defaults
|
|
|
|
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:
|
2018-02-24 23:18:47 +00:00
|
|
|
<<: *defaults
|
2018-02-18 11:49:36 +00:00
|
|
|
docker:
|
2018-02-28 03:02:59 +00:00
|
|
|
- image: circleci/golang:1.10
|
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 10:13:14 +00:00
|
|
|
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep
|
2018-02-18 09:36:05 +00:00
|
|
|
- run: dep ensure -vendor-only
|
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.*/
|
|
|
|
- lint:
|
2018-02-18 12:23:50 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-06-26 23:37:38 +00:00
|
|
|
- release:
|
|
|
|
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.*/
|