devzone 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/agent.sh +1 -1
- package/.devcontainer/argocd/apps.sh +2 -2
- package/.devcontainer/argocd/argocd.sh +22 -10
- package/.devcontainer/catalogue/app.sh +22 -4
- package/.devcontainer/catalogue/catalogue-veilleur.sh +2 -2
- package/.devcontainer/catalogue/mysql/mysql.sh +41 -28
- package/.devcontainer/catalogue/mysql/volume.sh +5 -5
- package/.devcontainer/catalogue.sh +29 -35
- package/.devcontainer/cluster.sh +11 -11
- package/.devcontainer/clusters.sh +1 -1
- package/.devcontainer/command-aliases.sh +152 -2
- package/.devcontainer/demarrage.sh +18 -15
- package/.devcontainer/devcontainer.json +1 -1
- package/.devcontainer/devzone +106 -118
- package/.devcontainer/docker-relais.sh +2 -2
- package/.devcontainer/docker-sans-hote.sh +1 -1
- package/.devcontainer/etat-json.sh +16 -16
- package/.devcontainer/etat.sh +4 -4
- package/.devcontainer/gitlab/gitlab.sh +24 -12
- package/.devcontainer/gitlab/installation.sh +9 -9
- package/.devcontainer/gitlab/secrets.sh +2 -2
- package/.devcontainer/gitlab/test-gitlab-restes.sh +16 -0
- package/.devcontainer/gitlab/test-gitlab.sh +14 -13
- package/.devcontainer/help.sh +40 -0
- package/.devcontainer/kube-compte.sh +2 -2
- package/.devcontainer/kube-config.sh +1 -1
- package/.devcontainer/kube-joignable.sh +2 -0
- package/.devcontainer/opencode.jsonc +1 -1
- package/.devcontainer/paquets.sh +31 -18
- package/.devcontainer/ports-auto.sh +6 -6
- package/.devcontainer/ports-json.sh +34 -0
- package/.devcontainer/ports.sh +34 -43
- package/.devcontainer/post-create.sh +3 -3
- package/.devcontainer/postgres/postgres.sh +42 -30
- package/.devcontainer/services-admin.sh +1 -1
- package/.devcontainer/skills/devzone/SKILL.md +16 -16
- package/README.md +17 -17
- package/manage/scripts/docker-workstation.sh +73 -0
- package/manage/scripts/lancer.sh +1 -1
- package/manage/scripts/migrer-retour.sh +1 -0
- package/manage/scripts/migrer.sh +6 -0
- package/manage/scripts/services-workspace.sh +1 -2
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
#
|
|
7
7
|
# command_canonical <name>: prints the current internal (French) name for an
|
|
8
8
|
# English name; otherwise the name unchanged (empty stays empty).
|
|
9
|
+
#
|
|
10
|
+
# Subcommands and options follow the same rule (#557): the table below gives
|
|
11
|
+
# the canonical English name of each French subcommand, per command, and the
|
|
12
|
+
# canonical English name of each French option.
|
|
9
13
|
|
|
10
14
|
command_canonical() {
|
|
11
15
|
case "${1:-}" in
|
|
@@ -30,7 +34,7 @@ command_canonical() {
|
|
|
30
34
|
migrate) echo migrer ;;
|
|
31
35
|
revert) echo revenir ;;
|
|
32
36
|
clean-docker) echo nettoyer-docker ;;
|
|
33
|
-
*)
|
|
37
|
+
*) printf '%s\n' "${1:-}" ;;
|
|
34
38
|
esac
|
|
35
39
|
}
|
|
36
40
|
|
|
@@ -59,7 +63,7 @@ command_english() {
|
|
|
59
63
|
migrer) echo migrate ;;
|
|
60
64
|
revenir) echo revert ;;
|
|
61
65
|
nettoyer-docker) echo clean-docker ;;
|
|
62
|
-
*)
|
|
66
|
+
*) printf '%s\n' "${1:-}" ;;
|
|
63
67
|
esac
|
|
64
68
|
}
|
|
65
69
|
|
|
@@ -77,3 +81,149 @@ command_deprecated_warning() {
|
|
|
77
81
|
fi
|
|
78
82
|
return 0
|
|
79
83
|
}
|
|
84
|
+
|
|
85
|
+
# subcommand_canonical <command> <word> : the canonical English name of a
|
|
86
|
+
# subcommand of a command (#557). The French names are accepted and warn on
|
|
87
|
+
# use; an unknown word is printed unchanged.
|
|
88
|
+
subcommand_canonical() {
|
|
89
|
+
local command="${1:-}" word="${2:-}"
|
|
90
|
+
case "$command" in
|
|
91
|
+
postgres | mysql)
|
|
92
|
+
case "$word" in
|
|
93
|
+
creer) echo create ;;
|
|
94
|
+
liste) echo list ;;
|
|
95
|
+
supprimer) echo delete ;;
|
|
96
|
+
supprimer-donnees) echo delete-data ;;
|
|
97
|
+
etat) echo status ;;
|
|
98
|
+
installer) echo install ;;
|
|
99
|
+
desinstaller) echo uninstall ;;
|
|
100
|
+
relais-lancer) echo relay-start ;;
|
|
101
|
+
relais-arreter) echo relay-stop ;;
|
|
102
|
+
autoriser) echo authorize ;;
|
|
103
|
+
interdire) echo forbid ;;
|
|
104
|
+
*) printf '%s\n' "$word" ;;
|
|
105
|
+
esac
|
|
106
|
+
;;
|
|
107
|
+
gitlab)
|
|
108
|
+
case "$word" in
|
|
109
|
+
migrer) echo migrate ;;
|
|
110
|
+
nouveau-mdp) echo new-password ;;
|
|
111
|
+
etat) echo status ;;
|
|
112
|
+
installer) echo install ;;
|
|
113
|
+
desinstaller) echo uninstall ;;
|
|
114
|
+
relais-lancer) echo relay-start ;;
|
|
115
|
+
relais-arreter) echo relay-stop ;;
|
|
116
|
+
relais-etat) echo relay-status ;;
|
|
117
|
+
*) printf '%s\n' "$word" ;;
|
|
118
|
+
esac
|
|
119
|
+
;;
|
|
120
|
+
argocd)
|
|
121
|
+
case "$word" in
|
|
122
|
+
etat) echo status ;;
|
|
123
|
+
installer) echo install ;;
|
|
124
|
+
desinstaller) echo uninstall ;;
|
|
125
|
+
relais-lancer) echo relay-start ;;
|
|
126
|
+
relais-arreter) echo relay-stop ;;
|
|
127
|
+
*) printf '%s\n' "$word" ;;
|
|
128
|
+
esac
|
|
129
|
+
;;
|
|
130
|
+
packages)
|
|
131
|
+
case "$word" in
|
|
132
|
+
ajouter) echo add ;;
|
|
133
|
+
retirer) echo remove ;;
|
|
134
|
+
appliquer) echo apply ;;
|
|
135
|
+
lister) echo list ;;
|
|
136
|
+
*) printf '%s\n' "$word" ;;
|
|
137
|
+
esac
|
|
138
|
+
;;
|
|
139
|
+
catalog)
|
|
140
|
+
case "$word" in
|
|
141
|
+
synchroniser) echo sync ;;
|
|
142
|
+
appliquer) echo apply ;;
|
|
143
|
+
lister) echo list ;;
|
|
144
|
+
desinstaller) echo remove ;;
|
|
145
|
+
*) printf '%s\n' "$word" ;;
|
|
146
|
+
esac
|
|
147
|
+
;;
|
|
148
|
+
port)
|
|
149
|
+
case "$word" in
|
|
150
|
+
ouvrir) echo open ;;
|
|
151
|
+
fermer) echo close ;;
|
|
152
|
+
liste) echo list ;;
|
|
153
|
+
relancer) echo restart ;;
|
|
154
|
+
exclure) echo exclude ;;
|
|
155
|
+
inclure) echo include ;;
|
|
156
|
+
*) printf '%s\n' "$word" ;;
|
|
157
|
+
esac
|
|
158
|
+
;;
|
|
159
|
+
*) printf '%s\n' "$word" ;;
|
|
160
|
+
esac
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
# option_canonical <word> : the canonical English name of an option (#557);
|
|
164
|
+
# an unknown option is printed unchanged.
|
|
165
|
+
option_canonical() {
|
|
166
|
+
case "${1:-}" in
|
|
167
|
+
--fermer) echo --close ;;
|
|
168
|
+
--supprimer) echo --delete ;;
|
|
169
|
+
--nouveau-mdp) echo --new-password ;;
|
|
170
|
+
--oui) echo --yes ;;
|
|
171
|
+
--confirmer) echo --confirm ;;
|
|
172
|
+
--contexte) echo --context ;;
|
|
173
|
+
*) printf '%s\n' "${1:-}" ;;
|
|
174
|
+
esac
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Deprecation warning for the old French subcommands (#557): same format and
|
|
178
|
+
# same DEVZONE_NO_DEPRECATION as command_deprecated_warning.
|
|
179
|
+
subcommand_deprecated_warning() {
|
|
180
|
+
local command="${1:-}" word="${2:-}" english
|
|
181
|
+
[ -n "$word" ] || return 0
|
|
182
|
+
english="$(subcommand_canonical "$command" "$word")"
|
|
183
|
+
[ "$english" != "$word" ] || return 0
|
|
184
|
+
if [ "${DEVZONE_NO_DEPRECATION:-}" != 1 ]; then
|
|
185
|
+
echo "devzone: \"$word\" is deprecated, use \"$english\"" >&2
|
|
186
|
+
fi
|
|
187
|
+
return 0
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
# Deprecation warning for the old French options (#557): same format and same
|
|
191
|
+
# DEVZONE_NO_DEPRECATION as command_deprecated_warning.
|
|
192
|
+
option_deprecated_warning() {
|
|
193
|
+
local word="${1:-}" english
|
|
194
|
+
[ -n "$word" ] || return 0
|
|
195
|
+
english="$(option_canonical "$word")"
|
|
196
|
+
[ "$english" != "$word" ] || return 0
|
|
197
|
+
if [ "${DEVZONE_NO_DEPRECATION:-}" != 1 ]; then
|
|
198
|
+
echo "devzone: \"$word\" is deprecated, use \"$english\"" >&2
|
|
199
|
+
fi
|
|
200
|
+
return 0
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
# canonical_args <command> <args...> : fills the global array ARGS_CANONICAL
|
|
204
|
+
# with the canonical English names of the arguments: the first word that is
|
|
205
|
+
# not an option is the subcommand, every option keeps its canonical English
|
|
206
|
+
# name. The old French names warn on use (#557).
|
|
207
|
+
canonical_args() {
|
|
208
|
+
local command="${1:-}" word canon premier=1
|
|
209
|
+
shift || true
|
|
210
|
+
ARGS_CANONICAL=()
|
|
211
|
+
for word in "$@"; do
|
|
212
|
+
case "$word" in
|
|
213
|
+
-*)
|
|
214
|
+
option_deprecated_warning "$word"
|
|
215
|
+
ARGS_CANONICAL+=("$(option_canonical "$word")")
|
|
216
|
+
;;
|
|
217
|
+
*)
|
|
218
|
+
if [ "$premier" = 1 ]; then
|
|
219
|
+
premier=0
|
|
220
|
+
canon="$(subcommand_canonical "$command" "$word")"
|
|
221
|
+
subcommand_deprecated_warning "$command" "$word"
|
|
222
|
+
word="$canon"
|
|
223
|
+
fi
|
|
224
|
+
ARGS_CANONICAL+=("$word")
|
|
225
|
+
;;
|
|
226
|
+
esac
|
|
227
|
+
done
|
|
228
|
+
return 0
|
|
229
|
+
}
|
|
@@ -13,51 +13,54 @@ exec </dev/null
|
|
|
13
13
|
ICI="$(dirname "$0")"
|
|
14
14
|
# Relais du socket Docker d'abord (#293) : sans lui, les docker exec longs
|
|
15
15
|
# (kind, modules) sont coupés au bout de 0,5 s sous Docker Desktop
|
|
16
|
-
DEVZONE_RELAIS_REEL=oui bash "$ICI/docker-relais.sh" || echo "démarrage : relais Docker non corrigé (devzone
|
|
17
|
-
bash "$ICI/git-identite.sh" || echo "démarrage : identité git non traitée (devzone
|
|
18
|
-
bash "$ICI/kube-config.sh" || echo "démarrage : clusters non traités (devzone
|
|
16
|
+
DEVZONE_RELAIS_REEL=oui bash "$ICI/docker-relais.sh" || echo "démarrage : relais Docker non corrigé (devzone repair)"
|
|
17
|
+
bash "$ICI/git-identite.sh" || echo "démarrage : identité git non traitée (devzone start)"
|
|
18
|
+
bash "$ICI/kube-config.sh" || echo "démarrage : clusters non traités (devzone start)"
|
|
19
19
|
# Jeton du compte Kubernetes limité (#430) : 24 h, renouvelé à chaque
|
|
20
20
|
# démarrage ; compte posé au passage s'il manque. Sans cluster des services
|
|
21
21
|
# choisi, rien à faire
|
|
22
|
-
bash "$ICI/kube-compte.sh" jeton || echo "démarrage : jeton du compte kubernetes non renouvelé (devzone
|
|
22
|
+
bash "$ICI/kube-compte.sh" jeton || echo "démarrage : jeton du compte kubernetes non renouvelé (devzone repair)"
|
|
23
23
|
# Module gitlab actif : /etc/hosts est un montage Docker régénéré à chaque
|
|
24
24
|
# démarrage, gitlab.localhost doit être re-pose (ssh, glab et getent passent
|
|
25
25
|
# par le résolveur système) ; hote-poser n'échoue jamais (avertissement seul)
|
|
26
26
|
if bash "$ICI/devzone" is-enabled gitlab; then
|
|
27
|
-
bash "$ICI/gitlab/gitlab.sh" hote-poser || echo "démarrage : nom gitlab.localhost non posé (devzone
|
|
27
|
+
bash "$ICI/gitlab/gitlab.sh" hote-poser || echo "démarrage : nom gitlab.localhost non posé (devzone repair)"
|
|
28
28
|
# Relais TCP 8929/2224 : curl et git en HTTP passent par la boucle locale
|
|
29
29
|
# pour *.localhost, le relais doit être relancé après chaque démarrage
|
|
30
|
-
bash "$ICI/gitlab/gitlab.sh"
|
|
30
|
+
bash "$ICI/gitlab/gitlab.sh" relay-start || echo "démarrage : relais gitlab non lancé (devzone repair)"
|
|
31
31
|
fi
|
|
32
32
|
# Module postgres actif : le relais (port-forward vers 127.0.0.1:5432) ne
|
|
33
33
|
# survit pas à l'arrêt du conteneur, relancé ici après les clusters
|
|
34
34
|
if bash "$ICI/devzone" is-enabled postgres; then
|
|
35
|
-
bash "$ICI/postgres/postgres.sh"
|
|
35
|
+
bash "$ICI/postgres/postgres.sh" relay-start || echo "démarrage : relais postgres non lancé (devzone repair)"
|
|
36
36
|
fi
|
|
37
37
|
# Module argocd actif : relais (port-forward vers 127.0.0.1:8443), relancé
|
|
38
38
|
# après les clusters comme celui de postgres
|
|
39
39
|
if bash "$ICI/devzone" is-enabled argocd; then
|
|
40
|
-
bash "$ICI/argocd/argocd.sh"
|
|
40
|
+
bash "$ICI/argocd/argocd.sh" relay-start || echo "démarrage : relais argocd non lancé (devzone repair)"
|
|
41
41
|
fi
|
|
42
42
|
# Module mysql actif : le relais 127.0.0.1:3306, relancé comme celui de
|
|
43
43
|
# postgres après chaque démarrage
|
|
44
44
|
if bash "$ICI/devzone" is-enabled mysql; then
|
|
45
|
-
bash "$ICI/catalogue/mysql/mysql.sh"
|
|
45
|
+
bash "$ICI/catalogue/mysql/mysql.sh" relay-start || echo "démarrage : relais mysql non lancé (devzone repair)"
|
|
46
46
|
fi
|
|
47
47
|
# Relais de ports vers le poste (#290) : l'IP du conteneur change à chaque
|
|
48
48
|
# démarrage, chaque relais de l'état est recréé ; un échec n'empêche rien
|
|
49
|
-
bash "$ICI/ports.sh"
|
|
49
|
+
bash "$ICI/ports.sh" restart || echo "démarrage : relais de ports non relancés (devzone repair)"
|
|
50
50
|
# Veilleur de ports automatiques vers le poste (#394, garde #293) : une seule
|
|
51
|
-
# instance en arrière-plan, contexte réel posé pour cet appel seulement
|
|
52
|
-
|
|
51
|
+
# instance en arrière-plan, contexte réel posé pour cet appel seulement.
|
|
52
|
+
# Kubernetes workspace (#517): no watcher, ports go through devzone workspace ports
|
|
53
|
+
if [ "${DEVZONE_WORKSPACE:-}" != kubernetes ]; then
|
|
54
|
+
DEVZONE_PORTS_AUTO_REEL=oui bash "$ICI/ports-auto.sh" demarrer >/dev/null 2>&1 || echo "démarrage : veilleur de ports auto non lancé (devzone repair)"
|
|
55
|
+
fi
|
|
53
56
|
# Catalogue d'applications : une ligne <app>=off par application absente,
|
|
54
57
|
# écrite une fois, jamais une ligne existante modifiée (#414)
|
|
55
|
-
bash "$ICI/catalogue.sh"
|
|
58
|
+
bash "$ICI/catalogue.sh" sync || echo "démarrage : catalogue non synchronisé (devzone repair)"
|
|
56
59
|
# Veilleur du catalogue : réapplique à chaud dès que .devzone.modules change
|
|
57
|
-
DEVZONE_CATALOGUE_REEL=oui bash "$ICI/catalogue/catalogue-veilleur.sh" demarrer >/dev/null 2>&1 || echo "démarrage : veilleur catalogue non lancé (devzone
|
|
60
|
+
DEVZONE_CATALOGUE_REEL=oui bash "$ICI/catalogue/catalogue-veilleur.sh" demarrer >/dev/null 2>&1 || echo "démarrage : veilleur catalogue non lancé (devzone repair)"
|
|
58
61
|
|
|
59
62
|
# Vue regroupée des identifiants (#332), regénérée à chaque démarrage ; un
|
|
60
63
|
# échec n'empêche rien et le contenu n'est jamais affiché
|
|
61
|
-
bash "$ICI/password.sh" regenerer || echo "démarrage : identifiants regroupés non mis à jour (devzone
|
|
64
|
+
bash "$ICI/password.sh" regenerer || echo "démarrage : identifiants regroupés non mis à jour (devzone repair)"
|
|
62
65
|
echo
|
|
63
66
|
bash "$ICI/devzone"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
// config globale) : le conteneur reconstruit peut commiter et pousser
|
|
46
46
|
"source=${localEnv:DEVZONE_VOLUMES:devzone}-gh,target=/home/vscode/.config/gh,type=volume",
|
|
47
47
|
"source=${localEnv:DEVZONE_VOLUMES:devzone}-git,target=/home/vscode/.config/git,type=volume",
|
|
48
|
-
// Modules activés (devzone
|
|
48
|
+
// Modules activés (devzone enable|desactiver) : état par instance
|
|
49
49
|
// ($RACINE/.devzone.modules) ; ce volume garde l'ancien état utilisateur
|
|
50
50
|
"source=${localEnv:DEVZONE_VOLUMES:devzone}-config,target=/home/vscode/.config/devzone,type=volume"
|
|
51
51
|
],
|