devzone 0.59.0 → 1.1.0

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.
Files changed (42) hide show
  1. package/.devcontainer/agent-erreurs.sh +72 -56
  2. package/.devcontainer/agent-etat-json.sh +45 -43
  3. package/.devcontainer/agent-modele.sh +3 -3
  4. package/.devcontainer/agent-session.sh +122 -125
  5. package/.devcontainer/agent-workspace.sh +53 -53
  6. package/.devcontainer/agent.sh +107 -109
  7. package/.devcontainer/argocd/argocd.sh +4 -16
  8. package/.devcontainer/catalogue/app.sh +1 -1
  9. package/.devcontainer/catalogue/catalogue-veilleur.sh +2 -2
  10. package/.devcontainer/catalogue/mysql/mysql.sh +1 -13
  11. package/.devcontainer/catalogue.sh +4 -16
  12. package/.devcontainer/cluster.sh +1 -1
  13. package/.devcontainer/command-aliases.sh +78 -114
  14. package/.devcontainer/devzone +34 -48
  15. package/.devcontainer/etat-json.sh +162 -162
  16. package/.devcontainer/etat-verrou.sh +25 -24
  17. package/.devcontainer/etat.sh +122 -123
  18. package/.devcontainer/gitlab/gitlab.sh +1 -13
  19. package/.devcontainer/gitlab/installation.sh +3 -3
  20. package/.devcontainer/gitlab/secrets.sh +1 -1
  21. package/.devcontainer/gitlab/test-gitlab.sh +1 -1
  22. package/.devcontainer/help.sh +4 -3
  23. package/.devcontainer/memoire.sh +58 -58
  24. package/.devcontainer/metrics-server.sh +52 -51
  25. package/.devcontainer/paquets.sh +0 -12
  26. package/.devcontainer/password.sh +88 -87
  27. package/.devcontainer/ports-auto.sh +6 -6
  28. package/.devcontainer/ports.sh +1 -13
  29. package/.devcontainer/postgres/postgres.sh +1 -13
  30. package/.devcontainer/services-admin.sh +3 -3
  31. package/.devcontainer/skills/devzone/SKILL.md +2 -2
  32. package/README.md +13 -3
  33. package/charts/devzone-workspace/templates/statefulset.yaml +3 -0
  34. package/manage/devzone +61 -569
  35. package/manage/scripts/argocd-services.sh +2 -2
  36. package/manage/scripts/devzone-create.sh +138 -0
  37. package/manage/scripts/devzone-manifest.sh +171 -0
  38. package/manage/scripts/devzone-update.sh +222 -0
  39. package/manage/scripts/migrer.sh +2 -6
  40. package/manage/scripts/workspace-aliases.sh +4 -31
  41. package/manage/workspace.sh +7 -12
  42. package/package.json +1 -1
@@ -1,47 +1,21 @@
1
1
  #!/usr/bin/env bash
2
- # English command names for the devzone CLI (#502).
2
+ # Renamed names of the devzone CLI (#695): the French names of the commands,
3
+ # subcommands and options are no longer accepted, they are refused. Each old
4
+ # name prints « ✖ « old » a été renommé : devzone new » on stderr, exits with
5
+ # code 1 and does nothing (no folder is created: « devzone stop » creates ./stop,
6
+ # « devzone mettre-a-jour » must not create ./mettre-a-jour).
3
7
  #
4
- # Why: English command names are accepted now; the French names stay valid
5
- # and warn on use (#532).
8
+ # renamed_command <name> : English name of a renamed command, or 1
9
+ # renamed_subcommand <command> <name> : English name of a renamed subcommand, or 1
10
+ # renamed_option <option> : English name of a renamed option, or 1
11
+ # reject_renamed <command> <args...> : refuses the first renamed name of a call
12
+ # (command, first word that is not an
13
+ # option, then each option); 0 if none
6
14
  #
7
- # command_canonical <name>: prints the current internal (French) name for an
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.
13
-
14
- command_canonical() {
15
- case "${1:-}" in
16
- is-enabled) echo actif ;;
17
- enable) echo activer ;;
18
- disable) echo desactiver ;;
19
- ai) echo ia ;;
20
- help) echo aide ;;
21
- apply) echo appliquer ;;
22
- catalog) echo catalogue ;;
23
- start) echo demarrer ;;
24
- stop) echo arreter ;;
25
- status) echo etat ;;
26
- passwords) echo mots-de-passe ;;
27
- packages) echo paquets ;;
28
- platform) echo plateforme ;;
29
- repair) echo reparer ;;
30
- use) echo utiliser ;;
31
- update) echo mettre-a-jour ;;
32
- uninstall) echo desinstaller ;;
33
- copy-to) echo copier-vers ;;
34
- copy-from) echo copier-depuis ;;
35
- migrate) echo migrer ;;
36
- revert) echo revenir ;;
37
- clean-docker) echo nettoyer-docker ;;
38
- *) printf '%s\n' "${1:-}" ;;
39
- esac
40
- }
15
+ # bash 3.2 (macOS): case only, no associative array.
41
16
 
42
- # English name of a French (internal) name; any other name unchanged.
43
- # Mirror of command_canonical, used by the deprecation warning (#532).
44
- command_english() {
17
+ # English name of a renamed command, or return 1.
18
+ renamed_command() {
45
19
  case "${1:-}" in
46
20
  actif) echo is-enabled ;;
47
21
  activer) echo enable ;;
@@ -65,29 +39,12 @@ command_english() {
65
39
  migrer) echo migrate ;;
66
40
  revenir) echo revert ;;
67
41
  nettoyer-docker) echo clean-docker ;;
68
- *) printf '%s\n' "${1:-}" ;;
42
+ *) return 1 ;;
69
43
  esac
70
44
  }
71
45
 
72
- # Deprecation warning for the old French names (#532): called at the
73
- # normalization points, with the word as typed. Writes one line on stderr
74
- # for a French name of the table; silent for an English name, an unknown
75
- # name and DEVZONE_NO_DEPRECATION=1. The exit code is always 0.
76
- command_deprecated_warning() {
77
- local word="${1:-}" english
78
- [ -n "$word" ] || return 0
79
- english="$(command_english "$word")"
80
- [ "$english" != "$word" ] || return 0
81
- if [ "${DEVZONE_NO_DEPRECATION:-}" != 1 ]; then
82
- echo "devzone: \"$word\" is deprecated, use \"$english\"" >&2
83
- fi
84
- return 0
85
- }
86
-
87
- # subcommand_canonical <command> <word> : the canonical English name of a
88
- # subcommand of a command (#557). The French names are accepted and warn on
89
- # use; an unknown word is printed unchanged.
90
- subcommand_canonical() {
46
+ # English name of a renamed subcommand of <command> (English name), or return 1.
47
+ renamed_subcommand() {
91
48
  local command="${1:-}" word="${2:-}"
92
49
  case "$command" in
93
50
  postgres | mysql)
@@ -103,7 +60,7 @@ subcommand_canonical() {
103
60
  relais-arreter) echo relay-stop ;;
104
61
  autoriser) echo authorize ;;
105
62
  interdire) echo forbid ;;
106
- *) printf '%s\n' "$word" ;;
63
+ *) return 1 ;;
107
64
  esac
108
65
  ;;
109
66
  gitlab)
@@ -116,7 +73,7 @@ subcommand_canonical() {
116
73
  relais-lancer) echo relay-start ;;
117
74
  relais-arreter) echo relay-stop ;;
118
75
  relais-etat) echo relay-status ;;
119
- *) printf '%s\n' "$word" ;;
76
+ *) return 1 ;;
120
77
  esac
121
78
  ;;
122
79
  argocd)
@@ -126,7 +83,7 @@ subcommand_canonical() {
126
83
  desinstaller) echo uninstall ;;
127
84
  relais-lancer) echo relay-start ;;
128
85
  relais-arreter) echo relay-stop ;;
129
- *) printf '%s\n' "$word" ;;
86
+ *) return 1 ;;
130
87
  esac
131
88
  ;;
132
89
  packages)
@@ -135,7 +92,7 @@ subcommand_canonical() {
135
92
  retirer) echo remove ;;
136
93
  appliquer) echo apply ;;
137
94
  lister) echo list ;;
138
- *) printf '%s\n' "$word" ;;
95
+ *) return 1 ;;
139
96
  esac
140
97
  ;;
141
98
  catalog)
@@ -144,7 +101,7 @@ subcommand_canonical() {
144
101
  appliquer) echo apply ;;
145
102
  lister) echo list ;;
146
103
  desinstaller) echo remove ;;
147
- *) printf '%s\n' "$word" ;;
104
+ *) return 1 ;;
148
105
  esac
149
106
  ;;
150
107
  port)
@@ -155,16 +112,38 @@ subcommand_canonical() {
155
112
  relancer) echo restart ;;
156
113
  exclure) echo exclude ;;
157
114
  inclure) echo include ;;
158
- *) printf '%s\n' "$word" ;;
115
+ *) return 1 ;;
116
+ esac
117
+ ;;
118
+ workspace)
119
+ case "$word" in
120
+ demarrer) echo start ;;
121
+ mettre-a-jour) echo update ;;
122
+ arreter) echo stop ;;
123
+ etat) echo status ;;
124
+ copier-vers) echo copy-to ;;
125
+ copier-depuis) echo copy-from ;;
126
+ migrer) echo migrate ;;
127
+ revenir) echo revert ;;
128
+ nettoyer-docker) echo clean-docker ;;
129
+ aide) echo help ;;
130
+ *) return 1 ;;
159
131
  esac
160
132
  ;;
161
- *) printf '%s\n' "$word" ;;
133
+ "workspace ports")
134
+ case "$word" in
135
+ demarrer) echo start ;;
136
+ arreter) echo stop ;;
137
+ etat) echo status ;;
138
+ *) return 1 ;;
139
+ esac
140
+ ;;
141
+ *) return 1 ;;
162
142
  esac
163
143
  }
164
144
 
165
- # option_canonical <word> : the canonical English name of an option (#557);
166
- # an unknown option is printed unchanged.
167
- option_canonical() {
145
+ # English name of a renamed option, or return 1.
146
+ renamed_option() {
168
147
  case "${1:-}" in
169
148
  --fermer) echo --close ;;
170
149
  --supprimer) echo --delete ;;
@@ -172,58 +151,43 @@ option_canonical() {
172
151
  --oui) echo --yes ;;
173
152
  --confirmer) echo --confirm ;;
174
153
  --contexte) echo --context ;;
175
- *) printf '%s\n' "${1:-}" ;;
154
+ --rapatrier) echo --bring-back ;;
155
+ *) return 1 ;;
176
156
  esac
177
157
  }
178
158
 
179
- # Deprecation warning for the old French subcommands (#557): same format and
180
- # same DEVZONE_NO_DEPRECATION as command_deprecated_warning.
181
- subcommand_deprecated_warning() {
182
- local command="${1:-}" word="${2:-}" english
183
- [ -n "$word" ] || return 0
184
- english="$(subcommand_canonical "$command" "$word")"
185
- [ "$english" != "$word" ] || return 0
186
- if [ "${DEVZONE_NO_DEPRECATION:-}" != 1 ]; then
187
- echo "devzone: \"$word\" is deprecated, use \"$english\"" >&2
188
- fi
189
- return 0
190
- }
191
-
192
- # Deprecation warning for the old French options (#557): same format and same
193
- # DEVZONE_NO_DEPRECATION as command_deprecated_warning.
194
- option_deprecated_warning() {
195
- local word="${1:-}" english
196
- [ -n "$word" ] || return 0
197
- english="$(option_canonical "$word")"
198
- [ "$english" != "$word" ] || return 0
199
- if [ "${DEVZONE_NO_DEPRECATION:-}" != 1 ]; then
200
- echo "devzone: \"$word\" is deprecated, use \"$english\"" >&2
159
+ # reject_renamed <command> <args...> : checks the command itself (top level),
160
+ # the first word of <args> that is not an option (subcommand), then every
161
+ # option. The first renamed name prints its message on stderr and returns 1;
162
+ # nothing is run. Returns 0 when no name is renamed.
163
+ reject_renamed() {
164
+ local command="${1:-}" word new
165
+ if [ "$#" -gt 0 ]; then shift; fi
166
+ if new="$(renamed_command "$command")"; then
167
+ # these commands only exist under « devzone workspace »
168
+ case "$command" in
169
+ migrer | revenir | copier-vers | copier-depuis | nettoyer-docker) new="workspace $new" ;;
170
+ esac
171
+ printf '✖ « %s » a été renommé : devzone %s\n' "$command" "$new" >&2
172
+ return 1
201
173
  fi
202
- return 0
203
- }
204
-
205
- # canonical_args <command> <args...> : fills the global array ARGS_CANONICAL
206
- # with the canonical English names of the arguments: the first word that is
207
- # not an option is the subcommand, every option keeps its canonical English
208
- # name. The old French names warn on use (#557).
209
- canonical_args() {
210
- local command="${1:-}" word canon premier=1
211
- shift || true
212
- ARGS_CANONICAL=()
174
+ for word in "$@"; do
175
+ case "$word" in
176
+ -*) continue ;;
177
+ esac
178
+ if new="$(renamed_subcommand "$command" "$word")"; then
179
+ printf '✖ « %s » a été renommé : devzone %s %s\n' "$word" "$command" "$new" >&2
180
+ return 1
181
+ fi
182
+ break
183
+ done
213
184
  for word in "$@"; do
214
185
  case "$word" in
215
186
  -*)
216
- option_deprecated_warning "$word"
217
- ARGS_CANONICAL+=("$(option_canonical "$word")")
218
- ;;
219
- *)
220
- if [ "$premier" = 1 ]; then
221
- premier=0
222
- canon="$(subcommand_canonical "$command" "$word")"
223
- subcommand_deprecated_warning "$command" "$word"
224
- word="$canon"
187
+ if new="$(renamed_option "$word")"; then
188
+ printf '✖ « %s » a été renommé : %s\n' "$word" "$new" >&2
189
+ return 1
225
190
  fi
226
- ARGS_CANONICAL+=("$word")
227
191
  ;;
228
192
  esac
229
193
  done
@@ -64,7 +64,7 @@ fi
64
64
  # change pas : deux montées simultanées (workflow versions) se fusionnent sans
65
65
  # conflit, git n'en signalant qu'entre lignes voisines modifiées.
66
66
  # Claude Code
67
- IA_CLAUDE=@anthropic-ai/claude-code@2.1.328
67
+ IA_CLAUDE=@anthropic-ai/claude-code@2.1.329
68
68
  # opencode
69
69
  IA_OPENCODE=opencode-ai@1.19.6
70
70
  IA_PAQUETS=("$IA_CLAUDE" "$IA_OPENCODE")
@@ -103,7 +103,7 @@ connu() {
103
103
  # ancien état global repris, copie de secours restaurée, état reconstruit
104
104
  # depuis le cluster des services, sinon première installation
105
105
  initialiser() {
106
- etat_initialiser "${MODULES[@]}"
106
+ state_init "${MODULES[@]}"
107
107
  }
108
108
 
109
109
  valeur() {
@@ -122,24 +122,24 @@ valeur() {
122
122
  # Verrou tenu de l'initialisation à l'écriture (#417) : l'état n'est jamais
123
123
  # recréé à vide entre les deux
124
124
  ecrire() {
125
- etat_verrou_prendre || return 1
126
- if ! initialiser || ! etat_ecrire "$1" "$2"; then
127
- etat_verrou_lacher
125
+ state_lock_take || return 1
126
+ if ! initialiser || ! state_write "$1" "$2"; then
127
+ state_lock_release
128
128
  return 1
129
129
  fi
130
- etat_verrou_lacher
130
+ state_lock_release
131
131
  return 0
132
132
  }
133
133
 
134
134
  # Retire une clé du fichier d'état : la configuration d'un service n'existe
135
135
  # que pendant qu'il est choisi (#242)
136
136
  retirer_cle() {
137
- etat_verrou_prendre || return 1
138
- if ! initialiser || ! etat_retirer "$1"; then
139
- etat_verrou_lacher
137
+ state_lock_take || return 1
138
+ if ! initialiser || ! state_remove "$1"; then
139
+ state_lock_release
140
140
  return 1
141
141
  fi
142
- etat_verrou_lacher
142
+ state_lock_release
143
143
  return 0
144
144
  }
145
145
 
@@ -737,8 +737,8 @@ appliquer_mysql() {
737
737
 
738
738
  # Toutes les bases disparaissent : confirmation en terminal (sans terminal, la
739
739
  # commande est explicite) ; un oui ou --yes marque SUPPRIMER_DONNEES, lu par
740
- # appliquer_mysql pour lancer supprimer-donnees (#441). Les arguments passent
741
- # par canonical_args : --oui arrive ici déjà traduit en --yes (#557).
740
+ # appliquer_mysql pour lancer delete-data (#441). Les arguments passent
741
+ # par reject_renamed : --oui est refusé avant d'arriver ici, seul --yes passe (#695).
742
742
  confirmer_suppression() {
743
743
  local app="$1" reponse arg
744
744
  SUPPRIMER_DONNEES=""
@@ -1454,7 +1454,7 @@ llm_retire_msg() {
1454
1454
  migrer_llm() {
1455
1455
  [ -f "$ETAT" ] || return 0
1456
1456
  grep -qE '^llm=' "$ETAT" 2>/dev/null || return 0
1457
- etat_retirer llm
1457
+ state_remove llm
1458
1458
  llm_retire_msg
1459
1459
  }
1460
1460
 
@@ -1468,7 +1468,7 @@ changer() {
1468
1468
  if [ "$m" = llm ]; then
1469
1469
  initialiser 2>/dev/null || true
1470
1470
  if [ -f "$ETAT" ] && grep -qE '^llm=' "$ETAT" 2>/dev/null; then
1471
- etat_retirer llm
1471
+ state_remove llm
1472
1472
  fi
1473
1473
  llm_retire_msg
1474
1474
  return 1
@@ -1523,36 +1523,21 @@ if [ -f "$ICI/etat-json.sh" ]; then
1523
1523
  . "$ICI/etat-json.sh"
1524
1524
  fi
1525
1525
 
1526
- # English command name of the first argument becomes the French one (#502);
1527
- # without any argument, nothing changes. The old French names warn (#532).
1528
- if [ "$#" -gt 0 ]; then
1529
- canon="$(command_canonical "$1" 2>/dev/null)" || canon="$1"
1530
- if command -v command_deprecated_warning >/dev/null 2>&1; then
1531
- command_deprecated_warning "$1"
1532
- fi
1533
- set -- "$canon" "${@:2}"
1526
+ # Renamed names (#695): an old French name is refused with its new name, before
1527
+ # anything runs (exit 1). Without the aliases file (copied devzone): no check.
1528
+ if command -v reject_renamed >/dev/null 2>&1; then
1529
+ reject_renamed "$@" || exit 1
1534
1530
  fi
1535
1531
 
1536
- # Options of activer, desactiver, cluster and utiliser take their English names
1537
- # (#557) : --context, --confirm, --yes ; the French ones warn (--oui included).
1538
- case "${1:-}" in
1539
- activer | desactiver | cluster | utiliser)
1540
- if command -v canonical_args >/dev/null 2>&1; then
1541
- canonical_args "$1" "${@:2}"
1542
- set -- "$1" "${ARGS_CANONICAL[@]+"${ARGS_CANONICAL[@]}"}"
1543
- fi
1544
- ;;
1545
- esac
1546
-
1547
1532
  case "${1:-}" in
1548
- "" | etat | modules) if [ "${2:-}" = "--json" ]; then etat_json; else etat; fi ;;
1549
- activer) changer on "${2:-}" "${@:3}" ;;
1550
- desactiver) changer off "${2:-}" "${@:3}" ;;
1551
- appliquer)
1533
+ "" | status | modules) if [ "${2:-}" = "--json" ]; then state_json; else etat; fi ;;
1534
+ enable) changer on "${2:-}" "${@:3}" ;;
1535
+ disable) changer off "${2:-}" "${@:3}" ;;
1536
+ apply)
1552
1537
  migrer_llm
1553
1538
  # L'utilisateur confirme l'état courant (#417, étape 4) : les
1554
1539
  # veilleurs peuvent de nouveau désinstaller
1555
- etat_recouvrement_confirmer
1540
+ state_recovery_confirm
1556
1541
  appliquer_repowarden
1557
1542
  [ "$(valeur ia)" = off ] || appliquer_ia on
1558
1543
  # gitlab, postgres, argocd: installed from the workstation in the
@@ -1562,7 +1547,7 @@ case "${1:-}" in
1562
1547
  [ "$(valeur mysql)" = off ] || appliquer_mysql on
1563
1548
  [ "$(valeur argocd)" = off ] || appliquer_service argocd
1564
1549
  ;;
1565
- actif)
1550
+ is-enabled)
1566
1551
  connu "${2:-}" || { echo "devzone : module inconnu : ${2:-(aucun)}" >&2; exit 2; }
1567
1552
  # Test silencieux, appelé par les scripts de démarrage : code 0 si le
1568
1553
  # module est actif, 1 sinon, sans rien écrire (kube-config.sh:16)
@@ -1571,7 +1556,7 @@ case "${1:-}" in
1571
1556
  agent)
1572
1557
  bash "$ICI/agent.sh" "${@:2}"
1573
1558
  ;;
1574
- ia)
1559
+ ai)
1575
1560
  case "${2:-}" in
1576
1561
  check)
1577
1562
  # Read-only: update state of each detected host model (#668).
@@ -1601,28 +1586,29 @@ case "${1:-}" in
1601
1586
  build)
1602
1587
  bash "$ICI/workspace-build.sh" "${@:2}"
1603
1588
  ;;
1604
- reparer) reparer ;;
1605
- demarrer) bash "$ICI/demarrage.sh" ;;
1589
+ repair) reparer ;;
1590
+ start) bash "$ICI/demarrage.sh" ;;
1606
1591
  metrics) bash "$ICI/metrics-server.sh" "${@:2}" ;;
1607
- utiliser) utiliser "${@:2}" ;;
1592
+ use) utiliser "${@:2}" ;;
1608
1593
  clusters) DEVZONE_ETAT="$ETAT" bash "$ICI/clusters.sh" "${@:2}" ;;
1609
1594
  cluster) changer_cluster "${@:2}" ;;
1610
1595
  postgres) DEVZONE_ETAT="$ETAT" bash "$ICI/postgres/postgres.sh" "${@:2}" ;;
1611
1596
  mysql) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue/mysql/mysql.sh" "${@:2}" ;;
1612
1597
  gitlab) DEVZONE_ETAT="$ETAT" bash "$ICI/gitlab/gitlab.sh" "${@:2}" ;;
1613
- catalogue) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue.sh" list ;;
1598
+ catalog) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue.sh" list ;;
1614
1599
  argocd) DEVZONE_ETAT="$ETAT" bash "$ICI/argocd/argocd.sh" "${@:2}" ;;
1615
1600
  port) DEVZONE_ETAT="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
1616
- paquets) bash "$ICI/paquets.sh" "${@:2}" ;;
1617
- mots-de-passe)
1601
+ packages) bash "$ICI/paquets.sh" "${@:2}" ;;
1602
+ passwords)
1618
1603
  bash "$ICI/password.sh" regenerer ||
1619
1604
  echo "devzone : identifiants regroupés non mis à jour" >&2
1620
1605
  bash "$ICI/password.sh" chemin
1621
1606
  ;;
1622
- -h | --help | aide) devzone_aide ;;
1607
+ -h | --help | help) devzone_aide ;;
1608
+ -v | --version) echo "devzone ${DEVZONE_VERSION:-unknown}" ;;
1623
1609
  test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
1624
1610
  test-gitlab) DEVZONE_ETAT="$ETAT" bash "$ICI/gitlab/test-gitlab.sh" "${@:2}" ;;
1625
- plateforme)
1611
+ platform)
1626
1612
  if [ -n "${2:-}" ]; then
1627
1613
  changer_plateforme "${@:2}"
1628
1614
  else