-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
65 lines (55 loc) · 1.85 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
version: "3"
# env:
# SOPS_AGE_KEY_FILE: "{{ .TASKFILE_DIR }}/.sops-key.txt"
# SOPS_AGE_RECIPIENTS:
# sh: "age-keygen -y {{ .SOPS_AGE_KEY_FILE | quote}}"
tasks:
default:
silent: true
cmds:
- task --list --sort none
generate:
- sea-orm-cli generate entity -o src/entity.example --expanded-format
docker-build:
vars:
GIT_COMMIT:
sh: git rev-parse --verify HEAD
GIT_COMMIT_TIMESTAMP:
sh: git show --no-patch --format=%cI
GIT_DESCRIBE:
sh: git describe --abbrev=10 --always
DOCKER_IMAGE_TAG: "ghcr.io/vtvz/rustify:{{ .GIT_DESCRIBE }}"
cmds:
- docker build --progress plain
--build-arg GIT_SHA={{ .GIT_COMMIT }}
--build-arg GIT_COMMIT_TIMESTAMP={{ .GIT_COMMIT_TIMESTAMP | quote }}
--build-arg GIT_DESCRIBE={{ .GIT_DESCRIBE | quote }}
-t {{ .DOCKER_IMAGE_TAG }} .
- docker build --progress plain
--build-arg GIT_SHA={{ .GIT_COMMIT }}
--build-arg GIT_COMMIT_TIMESTAMP={{ .GIT_COMMIT_TIMESTAMP | quote }}
--build-arg GIT_DESCRIBE={{ .GIT_DESCRIBE | quote }}
-t {{ .DOCKER_IMAGE_TAG }}-lyrics-provider lyrics-provider
docker-push:
vars:
GIT_DESCRIBE:
sh: git describe --abbrev=10 --always
DOCKER_IMAGE_TAG: "ghcr.io/vtvz/rustify:{{ .GIT_DESCRIBE }}"
cmds:
- docker push {{ .DOCKER_IMAGE_TAG }}
- docker push {{ .DOCKER_IMAGE_TAG }}-lyrics-provider
deploy:
dir: "_infra/ansible"
vars:
GIT_DESCRIBE:
sh: git describe --abbrev=10 --always
DOCKER_IMAGE_TAG: "ghcr.io/vtvz/rustify:{{ .GIT_DESCRIBE }}"
env: main
cmds:
- ansible-galaxy install -r requirements.yml
- ansible-playbook
-i inventory/{{ .env }}/hosts.ini
-e rustify_docker_image={{ .DOCKER_IMAGE_TAG | quote }}
-t project
--diff
playbook.yml