2018-02-01 13:38:43 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-02-01 13:40:37 +00:00
|
|
|
linting:
|
2018-02-01 13:38:43 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
working_directory: /go/src/github.com/filebrowser/filebrowser
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install Dependencies
|
2018-02-01 13:40:37 +00:00
|
|
|
command: |
|
|
|
|
cd cmd/filebrowser && go get ./... && cd ../..
|
2018-02-01 13:38:43 +00:00
|
|
|
go get github.com/alecthomas/gometalinter
|
2018-02-01 13:40:37 +00:00
|
|
|
gometalinter --install
|
2018-02-01 13:38:43 +00:00
|
|
|
- run:
|
|
|
|
name: Run linting
|
2018-02-01 13:40:37 +00:00
|
|
|
command: |
|
|
|
|
gometalinter --exclude="rice-box.go" \
|
|
|
|
-D goconst \
|
|
|
|
-D gocyclo \
|
|
|
|
-D vetshadow \
|
|
|
|
-D errcheck \
|
|
|
|
-D golint \
|
|
|
|
-D gas
|
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
working_directory: /go/src/github.com/filebrowser/filebrowser
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install Dependencies
|
|
|
|
command: |
|
|
|
|
cd cmd/filebrowser
|
|
|
|
go get ./...
|
|
|
|
- run:
|
|
|
|
name: Building
|
|
|
|
command: go build
|
|
|
|
deploy:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
working_directory: /go/src/github.com/filebrowser/filebrowser
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install Dependencies
|
|
|
|
command: |
|
|
|
|
cd cmd/filebrowser
|
|
|
|
go get ./...
|
|
|
|
cd ../..
|
|
|
|
- run:
|
|
|
|
name: Deploy
|
|
|
|
command: curl -sL https://git.io/goreleaser | bash
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
lint-build-deploy:
|
|
|
|
jobs:
|
|
|
|
- linting:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
branches:
|
|
|
|
only: /.*/
|
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
branches:
|
|
|
|
only: /.*/
|
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- linting
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|