php-fpm-exporter/.circleci/config.yml
2018-02-25 11:20:36 +11:00

60 lines
No EOL
1.7 KiB
YAML

defaults: &defaults
working_directory: /go/src/github.com/hipages/php-fpm_exporter
version: 2
jobs:
test:
<<: *defaults
docker:
- image: circleci/golang:1.9
steps:
- checkout
- 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 ./...
lint:
<<: *defaults
docker:
- image: circleci/golang:1.9
steps:
- checkout
- 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: 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=errcheck --enable=vet --enable=vetshadow ./...
deploy:
<<: *defaults
docker:
- image: circleci/golang:1.9
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- 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: curl -sL https://git.io/goreleaser | bash
workflows:
version: 2
build-n-deploy:
jobs:
- test:
filters:
tags:
only: /^v.*/
- lint:
filters:
tags:
only: /^v.*/
- deploy:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/