2018-02-18 00:55:06 +00:00
|
|
|
# Golang CircleCI 2.0 configuration file
|
|
|
|
#
|
|
|
|
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-02-18 11:49:36 +00:00
|
|
|
|
2018-02-18 00:55:06 +00:00
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
|
|
|
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-18 11:49:36 +00:00
|
|
|
deploy:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
|
|
|
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-18 12:23:50 +00:00
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-02-18 11:49:36 +00:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
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.*/
|