-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
55 lines (49 loc) · 1.24 KB
/
taskfile.yaml
File metadata and controls
55 lines (49 loc) · 1.24 KB
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
version: 3
vars:
repo: registry.cn-shanghai.aliyuncs.com/maoxuner/php
vers:
- 5.6.40
- 7.4.33
- 8.2.30
cri:
sh: command -v podman || command -v docker
tasks:
build:
deps:
- for: { var: vers }
task: build:image
vars:
version: "{{.ITEM}}"
build:image:
requires:
vars: [version]
vars:
workdir: "php{{ index (splitList \".\" .version) 0 }}"
dir: "{{.workdir}}"
cmds:
- for: [cli-alpine, fpm-alpine]
cmd: "{{.cri}} build --tag {{.repo}}:{{.version}}-{{.ITEM}} --build-arg=PHP_TAG={{.version}}-{{.ITEM}} ."
deploy:
deps:
- for: { var: vers }
task: deploy:image
vars:
version: "{{.ITEM}}"
deploy:image:
prompt: "Are you sure to deploy {{.version}}?"
requires:
vars: [version]
cmds:
- for: [cli-alpine, fpm-alpine]
cmd: "{{.cri}} push {{.repo}}:{{.version}}-{{.ITEM}}"
deps:
- task: build:image
vars:
version: "{{.version}}"
clean:
prompt: Are you sure to remove all images?
cmds:
- for: { var: vers }
cmd: "{{.cri}} rmi -f {{.repo}}:{{.ITEM}}-cli-alpine"
- for: { var: vers }
cmd: "{{.cri}} rmi -f {{.repo}}:{{.ITEM}}-fpm-alpine"