chore: circle CI (#14)

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias
2019-05-12 12:59:33 +01:00
committed by GitHub
parent 61462c1da7
commit 505a10a63d
4 changed files with 43 additions and 23 deletions
+42
View File
@@ -0,0 +1,42 @@
version: 2
jobs:
lint:
docker:
- image: golangci/golangci-lint:v1.16
steps:
- checkout
- run: golangci-lint run -v
build:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- run: cd cmd/webdav && go build main.go
release:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- run: curl -sL https://git.io/goreleaser | bash
workflows:
version: 2
build-workflow:
jobs:
- lint:
filters:
tags:
only: /.*/
- build:
filters:
tags:
only: /.*/
- release:
context: deploy
requires:
- build
- lint
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
-3
View File
@@ -1,3 +0,0 @@
config.yaml
config.yml
config.json
-19
View File
@@ -1,19 +0,0 @@
language: go
go: 1.12.x
env:
- "PATH=/home/travis/gopath/bin:$PATH GO111MODULE=on"
install:
- go get ./...
# Install gometalinter and certain linters
- env GO111MODULE=off go get github.com/alecthomas/gometalinter
- env GO111MODULE=off gometalinter --install
script:
- gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E goimports -E deadcode --tests ./...
- go test ./... -timeout 30s
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
+1 -1
View File
@@ -240,7 +240,7 @@ func basicAuth(c *cfg) http.Handler {
w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
username, password, authOK := r.BasicAuth()
if authOK == false {
if !authOK {
http.Error(w, "Not authorized", 401)
return
}