-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
70 lines (61 loc) · 1.71 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
version: '3'
vars:
REGISTRY: docker.io
IMAGE: skynewz/github-notifications-rss
BUILD_DATE:
sh: date -u +'%Y-%m-%dT%H:%M:%SZ'
VCS_REF:
sh: git rev-parse --short HEAD
tasks:
build-image:
internal: true
cmds:
- |
{{.CONTAINER_ENGINE}} build -t "{{.REGISTRY}}/{{.IMAGE}}:{{.VCS_REF}}" --build-arg BUILD_DATE={{.BUILD_DATE}} --build-arg VCS_REF={{.VCS_REF}} .
preconditions:
- sh: "command -v {{.CONTAINER_ENGINE}}"
msg: "command not found: {{.CONTAINER_ENGINE}}"
push-image:
internal: true
cmds:
- |
{{.CONTAINER_ENGINE}} push "{{.REGISTRY}}/{{.IMAGE}}:{{.VCS_REF}}"
{{.CONTAINER_ENGINE}} tag "{{.REGISTRY}}/{{.IMAGE}}:{{.VCS_REF}}" "{{.REGISTRY}}/{{.IMAGE}}:latest"
{{.CONTAINER_ENGINE}} push "{{.REGISTRY}}/{{.IMAGE}}:latest"
preconditions:
- sh: "command -v {{.CONTAINER_ENGINE}}"
msg: "command not found: {{.CONTAINER_ENGINE}}"
podman-build:
desc: Build image using Podman
cmds:
- task: build-image
vars:
CONTAINER_ENGINE: podman
podman-push:
desc: Push image using Podman
cmds:
- task: push-image
vars:
CONTAINER_ENGINE: podman
podman-build-push:
desc: Build and push image using Podman
cmds:
- task: podman-build
- task: podman-push
docker-build-push:
desc: Build and push image using Docker
cmds:
- task: docker-build
- task: docker-push
docker-build:
desc: Build image using Docker
cmds:
- task: build-image
vars:
CONTAINER_ENGINE: docker
docker-push:
desc: Push image using Docker
cmds:
- task: push-image
vars:
CONTAINER_ENGINE: docker