devzone 2.0.0 → 4.0.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 (100) hide show
  1. package/.devcontainer/agent-errors.sh +6 -6
  2. package/.devcontainer/agent-pod-manifest.sh +4 -4
  3. package/.devcontainer/agent-session.sh +2 -2
  4. package/.devcontainer/agent-state-json.sh +2 -2
  5. package/.devcontainer/agent-workspace.sh +1 -1
  6. package/.devcontainer/agent.sh +7 -7
  7. package/.devcontainer/ai/host-models.sh +2 -2
  8. package/.devcontainer/ai/plugins/devzone-guard-v2.js +3 -3
  9. package/.devcontainer/ai/plugins/devzone-guard.js +3 -3
  10. package/.devcontainer/argocd/argocd.sh +90 -89
  11. package/.devcontainer/argocd/catalog-argocd.sh +2 -2
  12. package/.devcontainer/argocd/services-hook.sh +3 -3
  13. package/.devcontainer/argocd/services.sh +1 -1
  14. package/.devcontainer/catalog/app.sh +114 -116
  15. package/.devcontainer/catalog/catalog-watcher.sh +62 -62
  16. package/.devcontainer/catalog/mysql/app.conf +1 -1
  17. package/.devcontainer/catalog/mysql/install.sh +40 -40
  18. package/.devcontainer/catalog/mysql/mysql.sh +141 -141
  19. package/.devcontainer/catalog/mysql/volume.sh +39 -39
  20. package/.devcontainer/catalog.sh +112 -112
  21. package/.devcontainer/chart-direct.sh +1 -1
  22. package/.devcontainer/cluster.sh +216 -218
  23. package/.devcontainer/clusters.sh +41 -41
  24. package/.devcontainer/command-aliases.sh +17 -8
  25. package/.devcontainer/devzone +93 -1496
  26. package/.devcontainer/devzone-ai-guard.sh +76 -0
  27. package/.devcontainer/devzone-ai.sh +201 -0
  28. package/.devcontainer/devzone-cluster.sh +210 -0
  29. package/.devcontainer/devzone-modules.sh +126 -0
  30. package/.devcontainer/devzone-platform.sh +189 -0
  31. package/.devcontainer/devzone-repair.sh +94 -0
  32. package/.devcontainer/devzone-services.sh +241 -0
  33. package/.devcontainer/devzone-skill.sh +97 -0
  34. package/.devcontainer/devzone-status.sh +140 -0
  35. package/.devcontainer/devzone-version.sh +78 -0
  36. package/.devcontainer/git-identity.sh +28 -0
  37. package/.devcontainer/gitlab/chart.sh +2 -2
  38. package/.devcontainer/gitlab/gitlab.sh +81 -82
  39. package/.devcontainer/gitlab/installation.sh +109 -109
  40. package/.devcontainer/gitlab/secrets.sh +47 -47
  41. package/.devcontainer/gitlab/seed.sh +77 -77
  42. package/.devcontainer/gitlab/test-gitlab.sh +242 -243
  43. package/.devcontainer/help.sh +1 -1
  44. package/.devcontainer/isolation.sh +30 -30
  45. package/.devcontainer/kind-wrapper.sh +17 -17
  46. package/.devcontainer/kube-account.sh +112 -113
  47. package/.devcontainer/kube-config.sh +45 -46
  48. package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
  49. package/.devcontainer/kube-reachable.sh +40 -40
  50. package/.devcontainer/memory.sh +1 -1
  51. package/.devcontainer/metrics-server.sh +2 -2
  52. package/.devcontainer/opencode.jsonc +2 -2
  53. package/.devcontainer/packages.sh +136 -135
  54. package/.devcontainer/password.sh +1 -1
  55. package/.devcontainer/ports-auto.sh +152 -153
  56. package/.devcontainer/ports-json.sh +16 -15
  57. package/.devcontainer/ports.sh +126 -122
  58. package/.devcontainer/post-create.sh +52 -52
  59. package/.devcontainer/postgres/postgres.sh +174 -174
  60. package/.devcontainer/rename-legacy-files.sh +103 -0
  61. package/.devcontainer/services-admin.sh +3 -3
  62. package/.devcontainer/skills/devzone/SKILL.md +40 -41
  63. package/.devcontainer/startup.sh +48 -49
  64. package/.devcontainer/state-gitops.sh +1 -1
  65. package/.devcontainer/state-json.sh +36 -62
  66. package/.devcontainer/state.sh +2 -2
  67. package/.devcontainer/workspace-init.sh +16 -2
  68. package/Makefile +1 -1
  69. package/README.md +191 -195
  70. package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
  71. package/manage/devzone +7 -11
  72. package/manage/scripts/argocd-workspace.sh +1 -1
  73. package/manage/scripts/{check-charts.sh → ci/check-charts.sh} +1 -1
  74. package/manage/scripts/{check-english.sh → ci/check-english.sh} +1 -1
  75. package/manage/scripts/{check-go-layout.sh → ci/check-go-layout.sh} +1 -1
  76. package/manage/scripts/{check-names.sh → ci/check-names.sh} +7 -6
  77. package/manage/scripts/{check-utf8-vars.sh → ci/check-utf8-vars.sh} +1 -1
  78. package/manage/scripts/{versions.sh → ci/versions.sh} +8 -8
  79. package/manage/scripts/create-cluster.sh +1 -1
  80. package/manage/scripts/create-mode.sh +11 -18
  81. package/manage/scripts/devzone-create.sh +7 -35
  82. package/manage/scripts/devzone-manifest.sh +1 -1
  83. package/manage/scripts/devzone-update.sh +12 -8
  84. package/manage/scripts/launch.sh +7 -48
  85. package/manage/scripts/ports-apps.sh +1 -1
  86. package/manage/scripts/ports-workspace.sh +7 -7
  87. package/manage/scripts/poste.sh +6 -7
  88. package/manage/scripts/uninstall.sh +8 -8
  89. package/manage/scripts/workspace-egress.sh +2 -2
  90. package/manage/scripts/workspace-update.sh +5 -2
  91. package/manage/scripts/workspace-wait.sh +2 -2
  92. package/manage/workspace.sh +2 -12
  93. package/package.json +1 -1
  94. package/.devcontainer/docker-relay.sh +0 -149
  95. package/.devcontainer/docker-without-host.sh +0 -12
  96. package/.devcontainer/git-identite.sh +0 -28
  97. package/manage/scripts/docker-workstation.sh +0 -73
  98. package/manage/scripts/migrate-revert.sh +0 -60
  99. package/manage/scripts/migrate.sh +0 -243
  100. /package/manage/scripts/{ci-dns.sh → ci/ci-dns.sh} +0 -0
@@ -1,86 +1,86 @@
1
1
  #!/usr/bin/env bash
2
- # Vue des clusters connectés (#337) : contextes visibles, type, état, namespace.
2
+ # View of the connected clusters (#337): visible contexts, type, state, namespace.
3
3
  ICI="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4
- if ! declare -F cluster_est_local >/dev/null 2>&1; then
4
+ if ! declare -F cluster_is_local >/dev/null 2>&1; then
5
5
  # shellcheck source=SCRIPTDIR/cluster.sh
6
6
  # shellcheck disable=SC1091
7
7
  . "$ICI/cluster.sh"
8
8
  fi
9
9
 
10
- # Affiche la vue des clusters connectés.
11
- clusters_afficher() {
12
- local contextes=() ctx ctx_travail ctx_services tmp i ns type etat marque marques
13
- ctx_travail="$(kubectl config current-context 2>/dev/null || true)"
14
- ctx_services="$(cluster_lu 2>/dev/null || true)"
10
+ # Shows the view of the connected clusters.
11
+ clusters_show() {
12
+ local contexts=() ctx ctx_work ctx_services tmp i ns type state mark marks
13
+ ctx_work="$(kubectl config current-context 2>/dev/null || true)"
14
+ ctx_services="$(cluster_saved 2>/dev/null || true)"
15
15
  while IFS= read -r ctx; do
16
16
  [ -n "$ctx" ] || continue
17
- contextes+=("$ctx")
17
+ contexts+=("$ctx")
18
18
  done < <(kubectl config get-contexts -o name 2>/dev/null || true)
19
19
 
20
- if [ "${#contextes[@]}" -eq 0 ]; then
21
- echo "aucun cluster : kind create cluster, ou devzone enable kubernetes"
20
+ if [ "${#contexts[@]}" -eq 0 ]; then
21
+ echo "no cluster: kind create cluster, or devzone enable kubernetes"
22
22
  return 0
23
23
  fi
24
24
 
25
- printf '%s %-14s %-8s %-12s %s\n' " " "CONTEXTE" "TYPE" "ÉTAT" "NAMESPACE"
25
+ printf '%s %-14s %-8s %-12s %s\n' " " "CONTEXT" "TYPE" "STATE" "NAMESPACE"
26
26
  tmp="$(mktemp -d)"
27
- for i in "${!contextes[@]}"; do
28
- ctx="${contextes[$i]}"
27
+ for i in "${!contexts[@]}"; do
28
+ ctx="${contexts[$i]}"
29
29
  (
30
30
  if kubectl --context "$ctx" --request-timeout=3s get --raw /readyz >/dev/null 2>&1; then
31
- echo joignable
31
+ echo reachable
32
32
  else
33
- echo injoignable
33
+ echo unreachable
34
34
  fi
35
35
  ) >"$tmp/$i" &
36
36
  done
37
37
  wait
38
- for i in "${!contextes[@]}"; do
39
- ctx="${contextes[$i]}"
40
- etat="$(cat "$tmp/$i" 2>/dev/null || echo injoignable)"
41
- if cluster_est_local "$ctx" >/dev/null 2>&1; then
38
+ for i in "${!contexts[@]}"; do
39
+ ctx="${contexts[$i]}"
40
+ state="$(cat "$tmp/$i" 2>/dev/null || echo unreachable)"
41
+ if cluster_is_local "$ctx" >/dev/null 2>&1; then
42
42
  type=local
43
43
  else
44
- type=distant
44
+ type=remote
45
45
  fi
46
46
  ns="$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"$ctx\")].context.namespace}" 2>/dev/null || true)"
47
47
  [ -n "$ns" ] || ns=default
48
- marque=""
49
- marques=0
50
- if [ "$ctx" = "$ctx_travail" ]; then
51
- marque+="★"
52
- marques=$((marques + 1))
48
+ mark=""
49
+ marks=0
50
+ if [ "$ctx" = "$ctx_work" ]; then
51
+ mark+="★"
52
+ marks=$((marks + 1))
53
53
  fi
54
54
  if [ "$ctx" = "$ctx_services" ]; then
55
- marque+="●"
56
- marques=$((marques + 1))
55
+ mark+="●"
56
+ marks=$((marks + 1))
57
57
  fi
58
- while [ "$marques" -lt 2 ]; do
59
- marque+=" "
60
- marques=$((marques + 1))
58
+ while [ "$marks" -lt 2 ]; do
59
+ mark+=" "
60
+ marks=$((marks + 1))
61
61
  done
62
- printf '%s %-14s %-8s %-12s %s\n' "$marque" "$ctx" "$type" "$etat" "$ns"
62
+ printf '%s %-14s %-8s %-12s %s\n' "$mark" "$ctx" "$type" "$state" "$ns"
63
63
  done
64
64
  rm -rf "$tmp"
65
65
  echo
66
- echo "★ cluster de travail (kubectl, k9s, helm) · ● cluster des services de devzone (devzone cluster)"
67
- # Affichage de l'état d'isolation NetworkPolicy pour le cluster des services
68
- if [ -n "$ctx_services" ] && cluster_est_local "$ctx_services"; then
66
+ echo "★ working cluster (kubectl, k9s, helm) · ● devzone services cluster (devzone cluster)"
67
+ # Display of the NetworkPolicy isolation state for the services cluster
68
+ if [ -n "$ctx_services" ] && cluster_is_local "$ctx_services"; then
69
69
  if kubectl --context "$ctx_services" get networkpolicy devzone-meme-namespace -n devzone-postgres >/dev/null 2>&1; then
70
- printf ' ✔ isolé (NetworkPolicy) → %s\n' "$ctx_services"
70
+ printf ' ✔ isolated (NetworkPolicy) → %s\n' "$ctx_services"
71
71
  else
72
- printf ' ⚠ isolé (NetworkPolicy manquant) → %s\n' "$ctx_services"
72
+ printf ' ⚠ isolated (NetworkPolicy missing) → %s\n' "$ctx_services"
73
73
  fi
74
74
  printf ' devzone → %s\n' "$ctx_services"
75
75
  fi
76
76
  return 0
77
77
  }
78
78
 
79
- # Alias de la commande devzone clusters.
80
- clusters() { clusters_afficher "$@"; }
81
- # Alias pour les tests et l appel direct.
82
- devzone_clusters() { clusters_afficher "$@"; }
79
+ # Aliases of the devzone clusters command.
80
+ clusters() { clusters_show "$@"; }
81
+ # Alias for the tests and direct calls.
82
+ devzone_clusters() { clusters_show "$@"; }
83
83
 
84
84
  if [ "${BASH_SOURCE[0]}" = "$0" ]; then
85
- clusters_afficher "$@"
85
+ clusters_show "$@"
86
86
  fi
@@ -36,9 +36,6 @@ renamed_command() {
36
36
  desinstaller) echo uninstall ;;
37
37
  copier-vers) echo copy-to ;;
38
38
  copier-depuis) echo copy-from ;;
39
- migrer) echo migrate ;;
40
- revenir) echo revert ;;
41
- nettoyer-docker) echo clean-docker ;;
42
39
  *) return 1 ;;
43
40
  esac
44
41
  }
@@ -123,9 +120,6 @@ renamed_subcommand() {
123
120
  etat) echo status ;;
124
121
  copier-vers) echo copy-to ;;
125
122
  copier-depuis) echo copy-from ;;
126
- migrer) echo migrate ;;
127
- revenir) echo revert ;;
128
- nettoyer-docker) echo clean-docker ;;
129
123
  aide) echo help ;;
130
124
  *) return 1 ;;
131
125
  esac
@@ -151,11 +145,17 @@ renamed_option() {
151
145
  --oui) echo --yes ;;
152
146
  --confirmer) echo --confirm ;;
153
147
  --contexte) echo --context ;;
154
- --rapatrier) echo --bring-back ;;
155
148
  *) return 1 ;;
156
149
  esac
157
150
  }
158
151
 
152
+ # Names removed in 3.0 (#735): refused with the same exit code, with a notice
153
+ # that names no former feature and never creates a folder.
154
+ removed_notice() {
155
+ echo "✖ this command or option was removed in devzone 3.0 (see manage/docs/migrating-to-3.md)" >&2
156
+ return 1
157
+ }
158
+
159
159
  # reject_renamed <command> <args...> : checks the command itself (top level),
160
160
  # the first word of <args> that is not an option (subcommand), then every
161
161
  # option. The first renamed name prints its message on stderr and returns 1;
@@ -163,10 +163,13 @@ renamed_option() {
163
163
  reject_renamed() {
164
164
  local command="${1:-}" word new
165
165
  if [ "$#" -gt 0 ]; then shift; fi
166
+ case "$command" in
167
+ migrer | revenir | nettoyer-docker) removed_notice; return 1 ;;
168
+ esac
166
169
  if new="$(renamed_command "$command")"; then
167
170
  # these commands only exist under « devzone workspace »
168
171
  case "$command" in
169
- migrer | revenir | copier-vers | copier-depuis | nettoyer-docker) new="workspace $new" ;;
172
+ copier-vers | copier-depuis) new="workspace $new" ;;
170
173
  esac
171
174
  printf '✖ « %s » a été renommé : devzone %s\n' "$command" "$new" >&2
172
175
  return 1
@@ -175,6 +178,11 @@ reject_renamed() {
175
178
  case "$word" in
176
179
  -*) continue ;;
177
180
  esac
181
+ if [ "$command" = workspace ]; then
182
+ case "$word" in
183
+ migrer | revenir | nettoyer-docker) removed_notice; return 1 ;;
184
+ esac
185
+ fi
178
186
  if new="$(renamed_subcommand "$command" "$word")"; then
179
187
  printf '✖ « %s » a été renommé : devzone %s %s\n' "$word" "$command" "$new" >&2
180
188
  return 1
@@ -183,6 +191,7 @@ reject_renamed() {
183
191
  done
184
192
  for word in "$@"; do
185
193
  case "$word" in
194
+ --rapatrier) removed_notice; return 1 ;;
186
195
  -*)
187
196
  if new="$(renamed_option "$word")"; then
188
197
  printf '✖ « %s » a été renommé : %s\n' "$word" "$new" >&2