-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
55 lines (47 loc) · 1.3 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
# https://taskfile.dev
version: '3'
vars:
PLUGIN_NAME: mrmarble/opsd
PLUGIN_VERSION:
sh: git describe --tags --dirty --always --abbrev=12 || echo 'dev'
tasks:
default:
silent: true
cmds:
- task: clean
- task: rootfs
- task: disable
- task: create
clean:
silent: true
desc: Remove temporal folders
cmds:
- rm -rf ./plugin
rootfs:
silent: true
desc: Build the rootfs needed for the plugin
cmds:
- docker build --build-arg VERSION={{.PLUGIN_VERSION}} -t {{.PLUGIN_NAME}}:rootfs .
- mkdir -p ./plugin/rootfs
- docker create --name opsd-rootfs {{.PLUGIN_NAME}}:rootfs
- docker export opsd-rootfs | tar -x -C ./plugin/rootfs
- docker rm -vf opsd-rootfs
create:
desc: Create Docker Plugin
cmds:
- docker plugin rm -f {{.PLUGIN_NAME}}:{{.PLUGIN_VERSION}} || true
- docker plugin create {{.PLUGIN_NAME}}:{{.PLUGIN_VERSION}} ./plugin
disable:
desc: Disable local plugin
cmds:
- docker plugin disable {{.PLUGIN_NAME}}:{{.PLUGIN_VERSION}} || true
enable:
desc: Enable local plugin
cmds:
- docker plugin enable {{.PLUGIN_NAME}}:{{.PLUGIN_VERSION}}
lint:
desc: Lint the code
cmds:
- go vet ./...
- go tool staticcheck ./...
- go tool revive ./...