This repository has been archived by the owner on May 2, 2022. It is now read-only.
forked from abdfnx/tran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
84 lines (67 loc) · 2.15 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
# https://taskfile.dev
version: "3"
vars:
TRAN_CONTAINER: trancli/tran
TRAN_FULL_CONTAINER: trancli/tran-full
tasks:
default:
deps: [ build, ght ]
set-tag-and-date:
cmds:
- if [ -f "date.txt" ]; then rm date.txt; fi
- if [ -f "tag.txt" ]; then rm tag.txt; fi
- go run ./scripts/date.go >> date.txt
- git describe --abbrev=0 --tags >> tag.txt
build:
cmds:
- task: set-tag-and-date
- go mod tidy -compat=1.17
- go build -ldflags "-X main.version=$(cat tag.txt) -X main.buildDate=$(cat date.txt)" -o tran
install:
deps: [ build ]
cmds:
- sudo mv tran /usr/local/bin
remove:
cmds:
- sudo rm -rf /usr/local/bin/tran
tran-container:
deps: [ just-build-tran-container, build-tran-container, build-tran-container-with-cache ]
tran-full-container:
deps: [ just-build-tran-full-container, build-tran-full-container, build-full-tran-container-with-cache ]
just-build-tran-container:
dir: ./docker/vm
cmds:
- docker build -t "{{ .TRAN_CONTAINER }}" .
build-tran-container:
deps: [ just-build-tran-container ]
dir: ./docker/vm
cmds:
- docker push "{{ .TRAN_CONTAINER }}"
build-tran-container-with-cache:
cmds:
- docker pull "{{ .TRAN_CONTAINER }}":latest
- docker build -t "{{ .TRAN_CONTAINER }}" --cache-from "{{ .TRAN_CONTAINER }}":latest .
- docker push "{{ .TRAN_CONTAINER }}"
just-build-tran-full-container:
dir: ./docker/container
cmds:
- docker build -t "{{ .TRAN_CONTAINER }}" .
build-tran-full-container:
deps: [ just-build-tran-full-container ]
dir: ./docker/container
cmds:
- docker push "{{ .TRAN_CONTAINER }}"
build-full-tran-container-with-cache:
cmds:
- docker pull "{{ .TRAN_CONTAINER }}":latest && \
- docker build -t "{{ .TRAN_CONTAINER }}" --cache-from "{{ .TRAN_CONTAINER }}":latest . && \
- docker push "{{ .TRAN_CONTAINER }}"
check_node_moduels:
dir: ./scripts/gh-tran
cmds:
- if ! [ -d "node_modules" ]; then yarn; fi
ght:
deps: [ build ]
cmds:
- task: check_node_moduels
- node ./scripts/gh-tran/gh-trn.js