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:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
steps:
|
|
|
|
- checkout
|
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
|
|
|
|
- run: go test -v ./...
|
2018-02-18 00:55:06 +00:00
|
|
|
|
2018-02-24 23:18:47 +00:00
|
|
|
lint:
|
|
|
|
<<: *defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-02-25 00:17:56 +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-02-24 23:18:47 +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 ./...
|
|
|
|
|
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:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
steps:
|
2018-02-18 11:50:08 +00:00
|
|
|
- checkout
|
2018-02-19 02:07:35 +00:00
|
|
|
- setup_remote_docker:
|
|
|
|
docker_layer_caching: true
|
|
|
|
- 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-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-02-18 12:17:46 +00:00
|
|
|
only: /^v.*/
|