-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
115 lines (103 loc) · 3.32 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '3'
silent: true
##
## === ⚒️ Variables ====================================================
##
vars:
#
# TASKFILE
VERSION: 1.0.0
CONTRIBUTOR: "Benoit Foujols, Julien Pechberty"
ENV: develop
REPOSITORY: https://raw.githubusercontent.com/JPechberty/tpm
DC_PKG_REPOSITORY: https://raw.githubusercontent.com/JPechberty/tpm-docker-compose/develop
SF_PKG_REPOSITORY: https://raw.githubusercontent.com/JPechberty/tpm-symfony/develop
#
# SYSTEM
PWD: $PWD
#
##
## === ⚒️ Includes ====================================================
##
includes:
dc:
taskfile: ./_tpm/docker-compose/Taskfile.yaml
optional: true
sf:
taskfile: ./_tpm/symfony/Taskfile.yaml
optional: true
##
## === ✅ TASKS ========================================================
##
tasks:
default:
cmds:
- task: help
## === 🆘 HELP ======================================================
help:
desc: "Description des tâches disponibles"
cmds:
- echo "Bienvenu dans TPM (Tasks Packages Manager)"
- echo "Voici la description de votre systeme:"
- echo 'Votre systeme "{{OS}}"'
- echo 'Votre architecture "{{ARCH}}"'
- echo "----------------------------------------------"
- task --list
#TODO: Ajouter un header No-cache à la requete curl update
update:
desc: "Update TPM"
cmds:
- curl -fsS {{.REPOSITORY}}/{{.ENV}}/Taskfile.yaml > Taskfile.yaml
- task: help
## === ⚙️ INTERFACES ================================================
list:
desc: "Show packages list"
cmds:
- echo "Listes des packages disponibles"
- echo "docker-compose - Docker-compose file generator"
- echo "symfony - Commandes de bases symfony 6"
- echo "Pour installer un package, éxécuter la commande suivante :"
- echo "task tpm:require -- 'nom_du_package'"
require:
desc: "Install package"
cmds:
- task: install-{{.CLI_ARGS}}-package
- echo "{{.CLI_ARGS}} package successfully installed"
preconditions:
- sh: "[ ! -d _tpm/{{.CLI_ARGS}} ]"
msg: "{{.CLI_ARGS}} package already installed"
remove:
desc: "Remove package"
cmds:
- rm -r _tpm/{{.CLI_ARGS}}
- echo "{{.CLI_ARGS}} package successfully removed"
preconditions:
- sh: "[ -d _tpm/{{.CLI_ARGS}} ]"
msg: "{{.CLI_ARGS}} is not already installed"
create-package-dir:
desc: "Create package dir"
internal: true
cmds:
- mkdir -p _tpm/{{.PACKAGE_NAME}}
preconditions:
- sh: "[ ! -d _tpm/{{.PACKAGE_NAME}} ]"
msg: "{{.PACKAGE_NAME}} directory already exists"
## === 📦 PACKAGES ==================================================
install-docker-compose-package:
desc: "Install docker-compose package"
internal: true
cmds:
- task: create-package-dir
vars:
PACKAGE_NAME: docker-compose
- curl -fsS {{.DC_PKG_REPOSITORY}}/Taskfile.yaml > ./_tpm/docker-compose/Taskfile.yaml
#TODO: Ajouter un header No-cache à la requete curl docker
install-symfony-package:
desc: "Install symfony package"
internal: true
cmds:
- task: create-package-dir
vars:
PACKAGE_NAME: symfony
- curl -fsS {{.SF_PKG_REPOSITORY}}/Taskfile.yaml > ./_tpm/symfony/Taskfile.yaml
#TODO: Ajouter un header No-cache à la requete curl symfony