-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
132 lines (111 loc) · 3.87 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# https://taskfile.dev
version: '3'
vars:
# Allow overriding with envvar.
TEST_PROJECT_ID:
sh: "echo ${TEST_PROJECT_ID:-muncus-dev2}"
tasks:
default:
cmds:
- echo "try 'task --list'"
silent: true
go:tests:
desc: "run tests, including e2e tests"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- gotestsum -f testname -- --timeout 30m {{.CLI_ARGS}}
env:
GOLANG_SAMPLES_E2E_TEST: true
GOLANG_SAMPLES_PROJECT_ID: "{{.TEST_PROJECT_ID}}"
go:testraw:
desc: "run tests, including e2e tests"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- go test {{.CLI_ARGS}}
env:
GOLANG_SAMPLES_E2E_TEST: true
GOLANG_SAMPLES_PROJECT_ID: "{{.TEST_PROJECT_ID}}"
go:rtidy:
desc: "go mod tidy in this, and all sub-packages."
dir: "{{.USER_WORKING_DIR}}"
env:
packages:
sh: find . -name go.mod | xargs dirname
cmds:
- for p in ${packages}; do cd {{.USER_WORKING_DIR}}/${p} && echo ${p} ; go mod tidy ; done
go:ptidy:
desc: "tidy a package in a relative path. requires -- before path."
dir: "{{.USER_WORKING_DIR}}"
env:
cmds:
- cd {{.CLI_ARGS}} && go mod tidy
go:update:
desc: "Update provided dependencies in current package. requires -- before path."
dir: "{{.USER_WORKING_DIR}}"
env:
cmds:
- go get -u {{.CLI_ARGS}} && go mod tidy
go:rupdate:
desc: "recursively update the provided package. requires -- before package."
dir: "{{.USER_WORKING_DIR}}"
ignore_error: true
env:
packages:
sh: find . -name go.mod | xargs dirname
cmds:
- for p in ${packages}; do cd {{.USER_WORKING_DIR}}/${p} && echo ${p} &&go get -u {{.CLI_ARGS}} ; done
go:subrun:
desc: "Run command in all subpackages. requires '--' before command"
dir: "{{.USER_WORKING_DIR}}"
ignore_error: true
env:
packages:
sh: find . -name go.mod | xargs dirname
cmds:
- for p in ${packages}; do cd {{.USER_WORKING_DIR}}/${p} && echo ${p} &&{{.CLI_ARGS}} || true ; done
## Terraform helpers
tf:fmt:
desc: "terraform format."
dir: "{{.USER_WORKING_DIR}}"
cmds:
- terraform fmt -recursive
## Python
py:flake:
desc: "run flake8 as done in python-docs-samples"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- flake8 --show-source --builtin=gettext --max-complexity=20 --import-order-style=google '--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py' --ignore=ANN101,E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202 --max-line-length=88 --application-import-names main,main_test,.nox,noxfile
py:fix:
desc: "run linters in fixing mode"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- black .
# - isort . #isort disagrees with flake8's import styleguides.
## Java Helpers
java:updatepom:
desc: "find recent versions of libraries in pom.xml w/ maven"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- mvn org.codehaus.mojo:versions-maven-plugin:2.11.0:use-latest-versions
## Renovatebot
renovate:local:
desc: "debug renovate configs by running locally"
dir: "{{.USER_WORKING_DIR}}"
cmds:
- npx -p renovate renovate-config-validator $RENOVATE_CONFIG_FILE
- LOG_LEVEL=debug npx renovate --platform local --require-config=ignored
# GCP project mangament
golang-samples:enable:
desc: enable an api in all golang-samples projects
env:
GO_SAMPLES_PROJECTS: "golang-samples-tests golang-samples-tests-2 golang-samples-tests-3 golang-samples-tests-4 golang-samples-tests-5"
cmds:
- for proj in $GO_SAMPLES_PROJECTS; do gcloud --configuration=goog --project $proj services enable {{.CLI_ARGS}} ; done
gcloud:goog:
cmds:
- gcloud config configurations activate goog
- gcloud auth login --update-adc
gcloud:joonix:
cmds:
- gcloud config configurations activate joonix
- gcloud auth login --update-adc