1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Upgrade own Taskfile to version 2

This commit is contained in:
Andrey Nering
2018-03-04 16:20:26 -03:00
parent 7c02097d93
commit 4f368923a5
2 changed files with 51 additions and 46 deletions

View File

@ -1,54 +1,57 @@
# compiles current source code and make "task" executable available on version: '2'
# $GOPATH/bin/task{.exe}
install:
desc: Installs Task
cmds:
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
dl-deps: tasks:
desc: Downloads cli dependencies # compiles current source code and make "task" executable available on
cmds: # $GOPATH/bin/task{.exe}
- go get -u github.com/golang/lint/golint install:
- go get -u github.com/asticode/go-astitodo/astitodo desc: Installs Task
- go get -u github.com/golang/dep/cmd/dep cmds:
- if [ "$CI" != "1" ]; then go get -u github.com/goreleaser/goreleaser; fi - go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
update-deps: dl-deps:
desc: Updates dependencies desc: Downloads cli dependencies
cmds: cmds:
- dep ensure - go get -u github.com/golang/lint/golint
- dep ensure -update - go get -u github.com/asticode/go-astitodo/astitodo
- go get -u github.com/golang/dep/cmd/dep
- if [ "$CI" != "1" ]; then go get -u github.com/goreleaser/goreleaser; fi
clean: update-deps:
desc: Cleans temp files and folders desc: Updates dependencies
cmds: cmds:
- rm -rf dist/ - dep ensure
- dep ensure -update
lint: clean:
desc: Runs golint desc: Cleans temp files and folders
cmds: cmds:
- golint {{.GO_PACKAGES}} - rm -rf dist/
silent: true
test: lint:
desc: Runs test suite desc: Runs golint
deps: [install] cmds:
cmds: - golint {{.GO_PACKAGES}}
- go test {{.GO_PACKAGES}} silent: true
# https://github.com/goreleaser/goreleaser test:
release: desc: Runs test suite
desc: Release Task deps: [install]
cmds: cmds:
- goreleaser - go test {{.GO_PACKAGES}}
test-release: # https://github.com/goreleaser/goreleaser
desc: Tests release process without publishing release:
cmds: desc: Release Task
- goreleaser --snapshot cmds:
- goreleaser
todo: test-release:
desc: Prints TODO comments present in the code desc: Tests release process without publishing
cmds: cmds:
- astitodo {{.GO_PACKAGES}} - goreleaser --snapshot
silent: true
todo:
desc: Prints TODO comments present in the code
cmds:
- astitodo {{.GO_PACKAGES}}
silent: true

View File

@ -1,6 +1,8 @@
version: '2' version: '2'
vars: vars:
NESTED2: "{{.NESTED1}}-TaskfileVars" NESTED2: "{{.NESTED1}}-TaskfileVars"
tasks: tasks:
default: default:
deps: [hello] deps: [hello]