php-fpm-exporter/.circleci/config.yml

60 lines
1.7 KiB
YAML
Raw Normal View History

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
2018-02-27 08:39:52 +00:00
- run: gometalinter --enable-all --disable=errcheck --disable=lll --deadline=5m --vendor ./...
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:
- image: circleci/golang:1.9
steps:
2018-02-18 11:50:08 +00:00
- checkout
- 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:
ignore: /.*/
2018-02-18 11:49:36 +00:00
tags:
2018-02-18 12:17:46 +00:00
only: /^v.*/