Add deploy step to CircleCI

This commit is contained in:
Enrico Stahn 2018-02-18 22:49:36 +11:00
parent 48c441a825
commit be3a7580b6
No known key found for this signature in database
GPG key ID: 5263621C269A50DE

View file

@ -3,14 +3,34 @@
# Check https://circleci.com/docs/2.0/language-go/ for more details # Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2 version: 2
jobs: jobs:
build: build:
docker: docker:
- image: circleci/golang:1.9 - image: circleci/golang:1.9
working_directory: /go/src/github.com/hipages/php-fpm_exporter working_directory: /go/src/github.com/hipages/php-fpm_exporter
steps: steps:
- checkout - 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: 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: dep ensure -vendor-only
- run: go test -v ./... - run: go test -v ./...
deploy:
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/hipages/php-fpm_exporter
steps:
- 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:
- build
- deploy:
requires:
- build
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/