This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Taskfile.yaml
115 lines (93 loc) · 2.25 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
# https://taskfile.dev
version: "3"
vars:
SECMAN_UNIX_PATH: /usr/local/bin
tasks:
default:
cmds:
- task: build
- yarn build
setup:
cmds:
- if [ -f "date.txt" ]; then rm date.txt; fi
- if [ -f "tag.txt" ]; then rm tag.txt; fi
- task: fix-vercel-go-mod
- go run ./scripts/date.go >> date.txt
- git describe --abbrev=0 --tags >> tag.txt
export-node-options:
cmds:
- export NODE_OPTIONS=--openssl-legacy-provider
remove:
cmds:
- sudo rm -rf "{{ .SECMAN_UNIX_PATH }}"/secman
install:
cmds:
- sudo mv secman "{{ .SECMAN_UNIX_PATH }}"
release:
cmds:
- task: node-checks
- BuildDate="$(cat date.txt)" goreleaser release --rm-dist --timeout 100m
build:
cmds:
- task: setup
- go mod tidy -compat=1.18
- go build -ldflags "-X main.version=$(cat tag.txt) -X main.buildDate=$(cat date.txt)" -o secman
build-scc:
dir: ./scc
cmds:
- if ! [ -d ./node_modules ]; then yarn; fi
- yarn build
build-smui:
dir: ./hub
cmds:
- task: setup
- yarn build
- mv dist ui
- cp ../tag.txt ui
- zip -9 -r smui.zip ui
build-docker:
cmds:
- task: build-docker-cli
- task: build-docker-container
link-scc:
dir: ./scc
cmds:
- npm link
publish-scc:
dir: ./scc
cmds:
- yarn publish
test:
cmds:
- yarn dev
deploy:
cmds:
- yarn deploy
bfs:
desc: build from source
cmds:
- task: build
- task: build-scc
- task: link-scc
- task: install
upload-scoop-manifest:
cmds:
- git clone https://github.com/scmn-dev/scoop
- cd scoop && rm secman.json && cp ../dist/secman.json .
node-checks:
cmds:
- if ! [ -d ./node_modules ]; then yarn; fi
- task: fix-vercel-go-mod
fix-vercel-go-mod:
cmds:
- if [ -d "node_modules" ]; then if ! [ -f "node_modules/@vercel/go/go.mod" ]; then touch node_modules/@vercel/go/go.mod; fi; fi
build-docker-cli:
dir: docker/cli
cmds:
- docker build -t smcr/secman-cli .
- docker push smcr/secman-cli
build-docker-container:
dir: docker/container
cmds:
- docker build -t smcr/secman .
- docker push smcr/secman