-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
83 lines (77 loc) · 2.17 KB
/
Taskfile.yml
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
version: '3'
tasks:
build:
cmds:
- docker build
--tag github_runner:org
--build-arg LABELS=darklab8,basic,v{{.VERSION}}
--target build-org .
- docker build
--tag github_runner:org-nodejs-14
--build-arg LABELS=darklab8,nodejs-14,v{{.VERSION}}
--target build-org-nodejs-14 .
- task: tag
vars:
TAG: "org"
- task: tag
vars:
TAG: "org-nodejs-14"
vars:
VERSION:
sh: git-conventional-commits version
tag:
cmds:
- docker tag github_runner:{{.TAG}} darkwind8/github_runner:{{.TAG}}-latest
- docker tag github_runner:{{.TAG}} darkwind8/github_runner:{{.TAG}}-v{{.VERSION}}
vars:
VERSION:
sh: git-conventional-commits version
push:
cmds:
- docker push darkwind8/github_runner:{{.TAG}}-latest
- docker push darkwind8/github_runner:{{.TAG}}-v{{.VERSION}}
vars:
VERSION:
sh: git-conventional-commits version
deploy:
cmds:
- task: build
- task: push
vars:
TAG: "org"
- task: push
vars:
TAG: "org-nodejs-14"
- task: git-tag
git-tag:
cmds:
- git tag v{{.VERSION}}
- git push origin v{{.VERSION}}
vars:
VERSION:
sh: git-conventional-commits version
version:
cmds:
- echo {{.VERSION}}
vars:
VERSION:
sh: git-conventional-commits version
org:launch:
cmds:
- defer: runuser -l user -c 'cd /app && ./config.sh remove --token {{.TOKEN}}'
- sleep 2 && echo 'receveing token'
- runuser -l user -c 'cd /app && ./config.sh --labels {{.LABELS}} --url {{.ORG_URL}} --token {{.TOKEN}} --unattended --disableupdate'
- dockerd & runuser -l user -c 'cd /app && ./run.sh'
env:
ORG_URL: undefined
ORG_TOKEN: undefined
ORG_NAME: undefined
vars:
TOKEN:
sh: >-
curl
-X POST
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer {{.ORG_TOKEN}}"
-H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/orgs/{{.ORG_NAME}}/actions/runners/registration-token | jq -r '.token'