devzone 7.1.0 → 7.1.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.
Files changed (53) hide show
  1. package/.devcontainer/Dockerfile +1 -8
  2. package/.devcontainer/catalog/app.sh +5 -12
  3. package/.devcontainer/cluster.sh +1 -11
  4. package/.devcontainer/devcontainer.json +1 -11
  5. package/.devcontainer/devzone +17 -9
  6. package/.devcontainer/devzone-cluster.sh +1 -1
  7. package/.devcontainer/devzone-modules.sh +7 -2
  8. package/.devcontainer/devzone-repair.sh +9 -19
  9. package/.devcontainer/devzone-services.sh +21 -20
  10. package/.devcontainer/devzone-status.sh +4 -12
  11. package/.devcontainer/help.sh +3 -4
  12. package/.devcontainer/isolation.sh +1 -1
  13. package/.devcontainer/kube-account.sh +12 -173
  14. package/.devcontainer/metrics-server.sh +1 -1
  15. package/.devcontainer/packages.sh +2 -2
  16. package/.devcontainer/ports-json.sh +0 -4
  17. package/.devcontainer/ports.sh +6 -102
  18. package/.devcontainer/state-json.sh +4 -14
  19. package/.devcontainer/versions.env +2 -2
  20. package/.devcontainer/workspace-init.sh +1 -2
  21. package/Makefile +4 -4
  22. package/README.md +13 -20
  23. package/bin/SHA256SUMS +6 -6
  24. package/bin/devzone-darwin-amd64 +0 -0
  25. package/bin/devzone-darwin-arm64 +0 -0
  26. package/bin/devzone-linux-amd64 +0 -0
  27. package/bin/devzone-linux-arm64 +0 -0
  28. package/bin/devzone-windows-amd64.exe +0 -0
  29. package/bin/devzone-windows-arm64.exe +0 -0
  30. package/manage/devzone +4 -4
  31. package/package.json +1 -1
  32. package/.devcontainer/argocd/argocd.sh +0 -222
  33. package/.devcontainer/argocd/catalog-argocd.sh +0 -119
  34. package/.devcontainer/argocd/services-hook.sh +0 -181
  35. package/.devcontainer/catalog/mysql/install.sh +0 -87
  36. package/.devcontainer/catalog/mysql/mysql.sh +0 -262
  37. package/.devcontainer/catalog/mysql/volume.sh +0 -71
  38. package/.devcontainer/git-identity.sh +0 -28
  39. package/.devcontainer/gitlab/argocd.sh +0 -54
  40. package/.devcontainer/gitlab/chart.sh +0 -39
  41. package/.devcontainer/gitlab/gitlab.sh +0 -168
  42. package/.devcontainer/gitlab/installation.sh +0 -193
  43. package/.devcontainer/gitlab/secrets.sh +0 -95
  44. package/.devcontainer/gitlab/seed.sh +0 -204
  45. package/.devcontainer/gitlab/test-gitlab-restes.sh +0 -16
  46. package/.devcontainer/gitlab/test-gitlab.sh +0 -489
  47. package/.devcontainer/kind-wrapper.sh +0 -45
  48. package/.devcontainer/kube-config.sh +0 -78
  49. package/.devcontainer/kube-reachable.sh +0 -64
  50. package/.devcontainer/ports-auto.sh +0 -247
  51. package/.devcontainer/post-create.sh +0 -91
  52. package/.devcontainer/postgres/postgres.sh +0 -309
  53. package/.devcontainer/startup.sh +0 -65
@@ -140,12 +140,6 @@ ENV PATH="/usr/local/go/bin:${PATH}" \
140
140
  GOCACHE=/home/vscode/.cache/go-build \
141
141
  GOPATH=/home/vscode/go
142
142
 
143
- # kind passe par une enveloppe (#291) : avec le Docker de l'hôte, un cluster
144
- # créé à la main doit être rendu joignable depuis le conteneur (kube-reachable.sh)
145
- COPY kube-reachable.sh /usr/local/lib/devzone/kube-reachable.sh
146
- COPY kind-wrapper.sh /usr/local/bin/kind
147
- RUN chmod 0644 /usr/local/lib/devzone/kube-reachable.sh && chmod 0755 /usr/local/bin/kind
148
-
149
143
  COPY --from=uv /uv /uvx /usr/local/bin/
150
144
 
151
145
  # ruff, vulture (repowarden code-mort a besoin des deux) et pytest, installés pour
@@ -166,7 +160,6 @@ RUN export UV_TOOL_DIR=/opt/uv/tools UV_TOOL_BIN_DIR=/usr/local/bin \
166
160
  RUN install -d -o 1000 -g 1000 /home/vscode/.local /home/vscode/.local/bin /home/vscode/.local/state /home/vscode/.local/share /home/vscode/.config
167
161
 
168
162
  # devzone scripts inside the image: the Kubernetes workspace pod has no
169
- # /workspaces/devzone checkout (#503). The Docker devcontainer relinks
170
- # /usr/local/bin/devzone to the mounted repository in post-create.sh.
163
+ # /workspaces/devzone checkout (#503).
171
164
  COPY . /usr/local/share/devzone/.devcontainer
172
165
  RUN ln -sf /usr/local/share/devzone/.devcontainer/devzone /usr/local/bin/devzone
@@ -6,9 +6,6 @@
6
6
 
7
7
  WAIT_SECONDS="${DEVZONE_CATALOG_WAIT:-300}"
8
8
 
9
- # shellcheck source=SCRIPTDIR/argocd/catalog-argocd.sh
10
- # shellcheck disable=SC1091
11
- . "$ICI/argocd/catalog-argocd.sh"
12
9
  # shellcheck source=SCRIPTDIR/chart-direct.sh
13
10
  # shellcheck disable=SC1091
14
11
  . "$ICI/chart-direct.sh"
@@ -89,17 +86,13 @@ app_install() {
89
86
  app_secret "$app" "$ns"
90
87
  local claim=donnees
91
88
  if [ "$app" = mysql ]; then
92
- # shellcheck source=SCRIPTDIR/mysql/volume.sh
93
- # shellcheck disable=SC1091
94
- . "$(catalog_dir)/mysql/volume.sh"
95
- claim="$(mysql_claim_choose "$ns")" || return 2
89
+ claim="$(devzone mysql claim "$ns")" || return 2
96
90
  [ "$claim" = donnees ] || extra="claim=$claim"
97
91
  fi
98
- if catalogue_argocd_active "$app"; then
92
+ if "$ICI/devzone" argocd catalog-active "$app"; then
99
93
  argo=1
100
94
  echo "▶ Application $app through Argo CD (chart charts/devzone-$app)…"
101
- catalogue_argocd_apply "$app" "$ns" "$image" "$port" \
102
- "$(app_read "$app" memoire)" "$(app_read "$app" taille)" "$extra" || return 1
95
+ "$ICI/devzone" argocd catalog-apply "$app" "$ns" "$image" "$port" "$(app_read "$app" memoire)" "$(app_read "$app" taille)" "$extra" || return 1
103
96
  else
104
97
  # Direct helm: the chart charts/devzone-<app>, the one definition (#559)
105
98
  chart_install "$app" "$ns" "image=$image" "port=$port" \
@@ -127,8 +120,8 @@ app_remove() {
127
120
  fi
128
121
  claim="$(kubectl --context devzone -n "$ns" get statefulset "$app" \
129
122
  -o jsonpath='{.spec.volumeClaimTemplates[0].metadata.name}' 2>/dev/null || true)"
130
- if catalogue_argocd_application_exists "$app"; then
131
- catalogue_argocd_delete "$app" >/dev/null 2>&1 || true
123
+ if "$ICI/devzone" argocd catalog-application-exists "$app"; then
124
+ "$ICI/devzone" argocd catalog-delete "$app" >/dev/null 2>&1 || true
132
125
  kubectl --context devzone -n "$ns" delete "secret/$app-admin" >/dev/null 2>&1 || true
133
126
  pvc="${claim:-donnees}-$app-0"
134
127
  echo "✔ $app removed: Application deleted; volume $pvc and databases kept: devzone $app volume"
@@ -14,7 +14,6 @@
14
14
  # (terminal only), otherwise local default
15
15
  # cluster_prepare CTX creates the dedicated kind cluster if missing
16
16
  # cluster_release CTX deletes the dedicated kind cluster once empty
17
- # kube_reachable_from_container FILE rewrites 127.0.0.1/localhost
18
17
  # relay_start NAME CTX NS TARGET PORTS… port-forward kept alive
19
18
  # relay_active NAME / relay_stop NAME
20
19
  # account_* (kube-account.sh #430) limited account and admin context
@@ -29,7 +28,7 @@ export KUBECONFIG
29
28
  : "${ETAT:=${DEVZONE_STATE:-$HOME/.devzone.modules}}"
30
29
 
31
30
  # Safe state write (#417): lock, temporary file in the state folder, backup copy
32
- # .prev — shared by devzone, ports and ports-auto
31
+ # .prev — shared by devzone, ports
33
32
  # shellcheck source=SCRIPTDIR/state.sh
34
33
  # shellcheck disable=SC1091
35
34
  . "$(dirname "${BASH_SOURCE[0]}")/state.sh"
@@ -47,11 +46,6 @@ CLUSTER_DEDICATED=kind-devzone${INSTANCE_SUFFIX}
47
46
  # labelled namespace has no use left and can be deleted
48
47
  CLUSTER_LABEL=app.kubernetes.io/managed-by=devzone
49
48
 
50
- # Rewrite 127.0.0.1 → host.docker.internal (#291): shared with the kind wrapper,
51
- # which applies it too to clusters created by hand
52
- # shellcheck source=SCRIPTDIR/kube-reachable.sh
53
- . "$(dirname "${BASH_SOURCE[0]}")/kube-reachable.sh"
54
-
55
49
  # Limited Kubernetes account (#430): account_setup, account_allow,
56
50
  # account_remove, account_token, account_admin (admin context); the installers
57
51
  # use it, cluster_release too
@@ -294,9 +288,6 @@ cluster_prepare() {
294
288
  if [ "$ctx" = "$CLUSTER_DEDICATED" ]; then
295
289
  if ! kind get clusters 2>/dev/null | grep -qx "devzone${INSTANCE_SUFFIX}"; then
296
290
  echo "▶ Creating the kind devzone cluster (about 1 min)…"
297
- # On the host Docker, the API listens on the workstation's 127.0.0.1:
298
- # kube_reachable_from_container makes it reachable from the container
299
- # (host.docker.internal), without exposing it on the local network.
300
291
  # Busy host Docker (its Kubernetes, other clusters): the node API can
301
292
  # restart during initialization and kind gives up within seconds. A
302
293
  # second attempt, on a fresh cluster.
@@ -305,7 +296,6 @@ cluster_prepare() {
305
296
  kind delete cluster --name "devzone${INSTANCE_SUFFIX}" >/dev/null 2>&1 || true
306
297
  kind_create_keep_context --name "devzone${INSTANCE_SUFFIX}" --wait 120s || return 1
307
298
  fi
308
- kube_reachable_from_container "$HOME/.kube/config"
309
299
  fi
310
300
  elif ! cluster_reachable "$ctx"; then
311
301
  echo "devzone : cluster $ctx unreachable (kubernetes module enabled? cluster started?)" >&2
@@ -21,7 +21,6 @@
21
21
  "version": "lts",
22
22
  "pnpmVersion": "latest"
23
23
  },
24
- "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
25
24
  "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
26
25
  "minikube": "none"
27
26
  },
@@ -57,19 +56,11 @@
57
56
  ],
58
57
 
59
58
  "runArgs": [
60
- // Cluster Kubernetes de l'hôte : sa config en lecture seule, adaptée au
61
- // conteneur par kube-config.sh. HOME (Mac, Linux) ou USERPROFILE (Windows) ;
62
- // -v plutôt que mounts : crée ~/.kube s'il manque au lieu d'échouer
63
- "-v", "${localEnv:HOME}${localEnv:USERPROFILE}/.kube:/home/vscode/.kube-host:ro",
64
59
  // host.docker.internal existe d'office avec Docker Desktop, pas sous Linux
65
60
  "--add-host=host.docker.internal:host-gateway"
66
61
  ],
67
62
 
68
- "postCreateCommand": "bash .devcontainer/post-create.sh",
69
- // Identité git, clusters, puis récapitulatif de ce qui reste à faire
70
- "postStartCommand": "bash .devcontainer/startup.sh",
71
- // Clusters kind du conteneur (config) + cluster de l'hôte (hote.config,
72
- // refait à chaque démarrage par kube-config.sh)
63
+ // Clusters kind du conteneur (config)
73
64
  "remoteEnv": {
74
65
  // Chemin du projet SUR L'HÔTE : nécessaire pour `docker run -v`, car les
75
66
  // chemins du conteneur n'existent pas pour le Docker de l'hôte
@@ -82,7 +73,6 @@
82
73
  // clusters kind. Permet à desinstalleur.sh de cibler uniquement les
83
74
  // ressources de l'instance courante.
84
75
  "DEVZONE_INSTANCE": "${localEnv:DEVZONE_VOLUMES:devzone}",
85
- "KUBECONFIG": "/home/vscode/.kube/config:/home/vscode/.kube/hote.config",
86
76
  // Claude Code range aussi .claude.json (connexion, réglages) dans ce
87
77
  // dossier, donc dans son volume, au lieu de ~/.claude.json
88
78
  "CLAUDE_CONFIG_DIR": "/home/vscode/.claude"
@@ -22,7 +22,11 @@ done
22
22
  ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
23
23
  # Go first (#754): a command ported to Go runs in the devzone-pod binary of the image.
24
24
  # DEVZONE_NO_GO=1 forces the shell, DEVZONE_FROM_GO=1 avoids loops.
25
- if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "${DEVZONE_FROM_GO:-}" ]; then
25
+ # DEVZONE_FROM_GO only concerns this call: not inherited, so that a "devzone …"
26
+ # run by this script reaches the Go command again (#864).
27
+ FROM_GO="${DEVZONE_FROM_GO:-}"
28
+ unset DEVZONE_FROM_GO
29
+ if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "$FROM_GO" ]; then
26
30
  case "$(uname -m)" in
27
31
  x86_64) POD_GO_ARCH=amd64 ;;
28
32
  aarch64 | arm64) POD_GO_ARCH=arm64 ;;
@@ -159,8 +163,8 @@ case "${1:-}" in
159
163
  ;;
160
164
  is-enabled)
161
165
  is_known "${2:-}" || { echo "devzone : unknown module : ${2:-(none)}" >&2; exit 2; }
162
- # Silent test, called by the startup scripts: code 0 if the module is
163
- # active, 1 otherwise, without writing anything (kube-config.sh:16)
166
+ # Silent test: code 0 if the module is active, 1 otherwise, without
167
+ # writing anything
164
168
  [ "$(value_of "$2")" = on ]
165
169
  ;;
166
170
  agent)
@@ -196,16 +200,21 @@ case "${1:-}" in
196
200
  bash "$ICI/workspace-build.sh" "${@:2}"
197
201
  ;;
198
202
  repair) repair_workstation ;;
199
- start) bash "$ICI/startup.sh" ;;
200
203
  metrics) bash "$ICI/metrics-server.sh" "${@:2}" ;;
201
204
  use) use_cluster "${@:2}" ;;
202
205
  clusters) DEVZONE_STATE="$ETAT" bash "$ICI/clusters.sh" "${@:2}" ;;
203
206
  cluster) change_cluster "${@:2}" ;;
204
- postgres) DEVZONE_STATE="$ETAT" bash "$ICI/postgres/postgres.sh" "${@:2}" ;;
205
- mysql) DEVZONE_STATE="$ETAT" bash "$ICI/catalog/mysql/mysql.sh" "${@:2}" ;;
206
- gitlab) DEVZONE_STATE="$ETAT" bash "$ICI/gitlab/gitlab.sh" "${@:2}" ;;
207
+ # Go only: reached when the binary did not take the call. Never call
208
+ # "devzone" again from here, it would loop forever, see #864
209
+ postgres | mysql | gitlab | test-gitlab)
210
+ echo "devzone $1: Go binary of the pod unavailable (.devcontainer/bin)" >&2
211
+ exit 1
212
+ ;;
207
213
  catalog) DEVZONE_STATE="$ETAT" bash "$ICI/catalog.sh" list ;;
208
- argocd) DEVZONE_STATE="$ETAT" bash "$ICI/argocd/argocd.sh" "${@:2}" ;;
214
+ argocd)
215
+ echo "devzone argocd: Go binary of the pod unavailable (.devcontainer/bin)" >&2
216
+ exit 1
217
+ ;;
209
218
  port) DEVZONE_STATE="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
210
219
  packages) bash "$ICI/packages.sh" "${@:2}" ;;
211
220
  passwords)
@@ -215,7 +224,6 @@ case "${1:-}" in
215
224
  ;;
216
225
  -h | --help | help) devzone_aide ;;
217
226
  test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
218
- test-gitlab) DEVZONE_STATE="$ETAT" bash "$ICI/gitlab/test-gitlab.sh" "${@:2}" ;;
219
227
  platform)
220
228
  if [ -n "${2:-}" ]; then
221
229
  change_platform "${@:2}"
@@ -112,7 +112,7 @@ change_cluster() {
112
112
  return 1
113
113
  fi
114
114
  # Installs PostgreSQL on the new cluster (via --context devzone which now points to it)
115
- bash "$ICI/postgres/postgres.sh" install
115
+ devzone postgres install
116
116
  else
117
117
  cluster_save "$ctx_new"
118
118
  # Sets the devzone context on the new cluster (cluster + user:
@@ -120,7 +120,12 @@ change_module() {
120
120
  confirm_removal "$m" "${@:3}" || return 0
121
121
  fi
122
122
  write_value "$m" "$1"
123
- # Services held by Argo CD (#559): 0 done, 3 helm direct as before, else failed
124
- if DEVZONE_STATE="$ETAT" bash "$ICI/argocd/services-hook.sh" "$m" "$1" "${@:3}"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
123
+ # Services held by Argo CD (#559): postgres and mysql, plus the release
124
+ # of the Applications when argocd is turned off. gitlab has its own path,
125
+ # the other modules go straight to their installer (hook exit 3).
126
+ if [ "$m" = postgres ] || [ "$m" = mysql ] || { [ "$m" = argocd ] && [ "$1" = off ]; }; then
127
+ # 0 done by Argo CD, 3 helm direct as before, else failed
128
+ if DEVZONE_STATE="$ETAT" devzone argocd services-hook "$m" "$1" "${@:3}"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
129
+ fi
125
130
  "apply_$m" "$1" "${@:3}"
126
131
  }
@@ -11,8 +11,8 @@ outdated_tools() {
11
11
  bash "$VERSIONS" --installees 2>/dev/null
12
12
  }
13
13
 
14
- # Sets repowarden back to the pinned version if it differs, like post-create.sh
15
- # (it installs the global git hooks)
14
+ # Sets repowarden back to the pinned version if it differs (it installs the
15
+ # global git hooks)
16
16
  apply_repowarden() {
17
17
  local line pinned installed package=repowarden
18
18
  [ -f "$VERSIONS" ] || return 0
@@ -45,8 +45,8 @@ missing_worktrees() {
45
45
  done || true
46
46
  }
47
47
 
48
- # Repair (#341): resumes the startup.sh sequence without the git identity nor
49
- # the clusters. Each item is really repaired; ✔ or ✖ with the reason.
48
+ # Repair (#341): repairs the workstation: relays, watchers, credentials.
49
+ # Each item is really repaired; ✔ or ✖ with the reason.
50
50
  repair_item() {
51
51
  local name="$1" output code reason
52
52
  shift
@@ -65,28 +65,18 @@ repair_item() {
65
65
  # does not stop the following ones.
66
66
  repair_workstation() {
67
67
  repair_failed=0
68
- # Limited Kubernetes account token (#430): 24 h, renewed here; without the
69
- # kubernetes module and without a services cluster, nothing to do
70
- if [ "$(value_of kubernetes)" = on ] || [ -n "$(cluster_saved)" ]; then
71
- repair_item "kubernetes account" bash "$ICI/kube-account.sh" jeton
72
- fi
73
68
  if [ "$(value_of gitlab)" = on ]; then
74
- repair_item "gitlab name" bash "$ICI/gitlab/gitlab.sh" hote-poser
75
- repair_item "gitlab relay" bash "$ICI/gitlab/gitlab.sh" relay-start
69
+ repair_item "gitlab name" devzone gitlab hote-poser
70
+ repair_item "gitlab relay" devzone gitlab relay-start
76
71
  fi
77
72
  if [ "$(value_of postgres)" = on ]; then
78
- repair_item "postgres relay" bash "$ICI/postgres/postgres.sh" relay-start
73
+ repair_item "postgres relay" devzone postgres relay-start
79
74
  fi
80
75
  if [ "$(value_of argocd)" = on ]; then
81
- repair_item "argocd relay" bash "$ICI/argocd/argocd.sh" relay-start
76
+ repair_item "argocd relay" "$ICI/devzone" argocd relay-start
82
77
  fi
83
78
  if [ "$(value_of mysql)" = on ]; then
84
- repair_item "mysql relay" bash "$ICI/catalog/mysql/mysql.sh" relay-start
85
- fi
86
- repair_item "ports relay" bash "$ICI/ports.sh" restart
87
- # Kubernetes workspace (#517): no automatic port watcher
88
- if ! in_pod; then
89
- repair_item "ports auto watcher" env DEVZONE_PORTS_AUTO_REAL=yes bash "$ICI/ports-auto.sh" demarrer
79
+ repair_item "mysql relay" devzone mysql relay-start
90
80
  fi
91
81
  repair_item "catalog watcher" env DEVZONE_CATALOG_REAL=yes bash "$ICI/catalog/catalog-watcher.sh" demarrer
92
82
  repair_item "credentials" bash "$ICI/password.sh" regenerer
@@ -82,7 +82,8 @@ apply_service() {
82
82
 
83
83
  apply_kubernetes() {
84
84
  if [ "$1" = on ]; then
85
- bash "$ICI/kube-config.sh"
85
+ # Clusters are connected from the workstation; no script to run here.
86
+ return 0
86
87
  else
87
88
  rm -f "$HOME/.kube/hote.config"
88
89
  # metrics-server removed from the clusters where devzone installed it
@@ -96,16 +97,16 @@ apply_gitlab() {
96
97
  local current_state
97
98
  if [ "$1" = on ]; then
98
99
  # Skip if the state is ready and the runner online; otherwise install resumes
99
- current_state="$(bash "$ICI/gitlab/gitlab.sh" status)"
100
+ current_state="$(devzone gitlab status)"
100
101
  if [[ "$current_state" == *"ready"* && "$current_state" == *"runner online"* ]]; then
101
102
  echo "devzone : gitlab already active, nothing to do."
102
103
  # /etc/hosts regenerated by Docker: gitlab.localhost is set again here too
103
- bash "$ICI/gitlab/gitlab.sh" hote-poser
104
+ devzone gitlab hote-poser
104
105
  # Failure of an old run cleared: gitlab is ready (#366)
105
106
  rm -f "$(failure_marker_file gitlab)"
106
107
  else
107
108
  echo "devzone : activating gitlab via its installer…"
108
- if ! bash "$ICI/gitlab/gitlab.sh" install; then
109
+ if ! devzone gitlab install; then
109
110
  echo "gitlab" > "$(failure_marker_file gitlab)"
110
111
  return 1
111
112
  fi
@@ -113,12 +114,12 @@ apply_gitlab() {
113
114
  fi
114
115
  else
115
116
  # Disable gitlab only if its namespace still exists
116
- if bash "$ICI/gitlab/gitlab.sh" installe; then
117
+ if devzone gitlab installe; then
117
118
  echo "devzone : deactivating gitlab…"
118
119
  if [ -n "${DELETE_DATA:-}" ]; then
119
- bash "$ICI/gitlab/gitlab.sh" uninstall --yes
120
+ devzone gitlab uninstall --yes
120
121
  else
121
- bash "$ICI/gitlab/gitlab.sh" uninstall
122
+ devzone gitlab uninstall
122
123
  fi
123
124
  else
124
125
  echo "devzone : gitlab already deactivated (no devzone-gitlab namespace)."
@@ -164,20 +165,20 @@ apply_postgres() {
164
165
  fi
165
166
  # Choice kept before the installation: a resume targets the same cluster
166
167
  cluster_save "$ctx"
167
- current_state="$(bash "$ICI/postgres/postgres.sh" status)"
168
+ current_state="$(devzone postgres status)"
168
169
  # "relay stopped" first: this line also starts with "ready on"
169
170
  if [[ "$current_state" == *"relay stopped"* ]]; then
170
- bash "$ICI/postgres/postgres.sh" relay-start
171
+ devzone postgres relay-start
171
172
  echo "devzone : postgres : relay restarted"
172
173
  elif [[ "$current_state" == "ready on"* ]]; then
173
174
  echo "devzone : postgres already active, nothing to do."
174
- elif ! bash "$ICI/postgres/postgres.sh" install; then
175
+ elif ! devzone postgres install; then
175
176
  echo "postgres" >"$(failure_marker_file postgres)"
176
177
  return 1
177
178
  fi
178
179
  rm -f "$(failure_marker_file postgres)"
179
180
  else
180
- bash "$ICI/postgres/postgres.sh" uninstall
181
+ devzone postgres uninstall
181
182
  rm -f "$(failure_marker_file postgres)"
182
183
  fi
183
184
  }
@@ -187,26 +188,26 @@ apply_postgres() {
187
188
  apply_argocd() {
188
189
  local current_state
189
190
  if [ "$1" = on ]; then
190
- current_state="$(bash "$ICI/argocd/argocd.sh" status)"
191
+ current_state="$("$ICI/devzone" argocd status)"
191
192
  # "relay stopped" first: this line also starts with "ready"
192
193
  if [[ "$current_state" == *"relay stopped"* ]]; then
193
- bash "$ICI/argocd/argocd.sh" relay-start
194
+ "$ICI/devzone" argocd relay-start
194
195
  echo "devzone : argocd : relay restarted"
195
196
  elif [[ "$current_state" == "ready"* ]]; then
196
197
  echo "devzone : argocd already active, nothing to do."
197
- elif ! bash "$ICI/argocd/argocd.sh" install; then
198
+ elif ! "$ICI/devzone" argocd install; then
198
199
  echo "argocd" >"$(failure_marker_file argocd)"
199
200
  return 1
200
201
  fi
201
202
  rm -f "$(failure_marker_file argocd)"
202
203
  else
203
- bash "$ICI/argocd/argocd.sh" uninstall
204
+ "$ICI/devzone" argocd uninstall
204
205
  rm -f "$(failure_marker_file argocd)"
205
206
  fi
206
207
  }
207
208
 
208
209
  # Catalog MySQL (#414): same logic as postgres (relay restarted if stopped),
209
- # installation delegated to mysql.sh
210
+ # installation delegated to the Go module
210
211
  apply_mysql() {
211
212
  local current_state ctx
212
213
  if [ "$1" = on ]; then
@@ -217,14 +218,14 @@ apply_mysql() {
217
218
  echo mysql >"$(failure_marker_file mysql)"
218
219
  return 2
219
220
  fi
220
- current_state="$(bash "$ICI/catalog/mysql/mysql.sh" status)"
221
+ current_state="$(devzone mysql status)"
221
222
  # "relay stopped" first: this line also starts with "ready on"
222
223
  if [[ "$current_state" == *"relay stopped"* ]]; then
223
- bash "$ICI/catalog/mysql/mysql.sh" relay-start
224
+ devzone mysql relay-start
224
225
  echo "devzone : mysql: relay restarted"
225
226
  elif [[ "$current_state" == "ready on"* ]]; then
226
227
  echo "devzone : mysql already active, nothing to do."
227
- elif ! bash "$ICI/catalog/mysql/mysql.sh" install; then
228
+ elif ! devzone mysql install; then
228
229
  echo mysql >"$(failure_marker_file mysql)"
229
230
  return 1
230
231
  fi
@@ -234,7 +235,7 @@ apply_mysql() {
234
235
  # only leave with a yes (confirm_removal)
235
236
  bash "$ICI/catalog.sh" remove mysql
236
237
  if [ -n "${DELETE_DATA:-}" ]; then
237
- bash "$ICI/catalog/mysql/mysql.sh" delete-data --yes
238
+ devzone mysql delete-data --yes
238
239
  fi
239
240
  rm -f "$(failure_marker_file mysql)"
240
241
  fi
@@ -63,13 +63,13 @@ show_state() {
63
63
  printf ' ✖ module %-10s failed: incomplete install (%s): devzone apply\n' "$m" "$(cat "$(failure_marker_file "$m")")"
64
64
  elif [ "$(value_of "$m")" = on ] && [ "$m" = gitlab ]; then
65
65
  # gitlab active: its real state (ready, runner, failed)
66
- printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/gitlab/gitlab.sh" status)"
66
+ printf ' ✔ module %-10s %s\n' "$m" "$(devzone gitlab status)"
67
67
  elif [ "$(value_of "$m")" = on ] && [ "$m" = postgres ]; then
68
- printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/$m/$m.sh" status)"
68
+ printf ' ✔ module %-10s %s\n' "$m" "$(devzone postgres status)"
69
69
  elif [ "$(value_of "$m")" = on ] && [ "$m" = argocd ]; then
70
- printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/argocd/argocd.sh" status)"
70
+ printf ' ✔ module %-10s %s\n' "$m" "$("$ICI/devzone" argocd status)"
71
71
  elif [ "$(value_of "$m")" = on ] && [ "$m" = mysql ]; then
72
- printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/catalog/mysql/mysql.sh" status)"
72
+ printf ' ✔ module %-10s %s\n' "$m" "$(devzone mysql status)"
73
73
  elif [ "$(value_of "$m")" = on ]; then
74
74
  printf ' ✔ module %-10s active: %s\n' "$m" "$(description "$m")"
75
75
  else
@@ -98,14 +98,6 @@ show_state() {
98
98
  if [ -n "$current_cluster" ] && ! cluster_is_local "$current_cluster"; then
99
99
  printf ' ⚠ cluster remote: %s — services on a remote cluster\n' "$current_cluster"
100
100
  fi
101
- # Limited account token (#845): renewed as soon as it is close to expiry,
102
- # only outside the pod and with a services cluster chosen (the cases where
103
- # kube-account.sh is used); a failed renewal is reported for devzone repair
104
- if ! in_pod && [ -n "$current_cluster" ] && ! account_token_fresh; then
105
- if ! bash "$ICI/kube-account.sh" jeton >/dev/null 2>&1; then
106
- echo " ⚠ limited account token expired: devzone repair"
107
- fi
108
- fi
109
101
  devzone cluster clean --quiet || true
110
102
  # Old kind-gitlab cluster still present: invite to migrate (#396)
111
103
  if kind get clusters 2>/dev/null | grep -qx "gitlab${INSTANCE_SUFFIX}"; then
@@ -12,13 +12,12 @@ devzone_aide() {
12
12
  devzone platform gitlab GitLab, [--url URL] (default: gitlab module)
13
13
  devzone enable <module> enable and apply at once
14
14
  devzone disable <module> [--yes] disable and apply at once (--yes: also deletes the data)
15
- devzone apply install what is enabled (post-create.sh)
15
+ devzone apply install what is enabled
16
16
  devzone repair repair gitlab, postgres, ports, passwords
17
- devzone start full start (startup scripts and summary)
18
17
  devzone metrics [context…] install metrics-server (kubectl top, k9s)
19
18
  devzone use CTX [--confirm CTX] switch the kubectl working cluster
20
19
  devzone clusters view of the connected clusters (work and services)
21
- devzone is-enabled <module> code 0 if enabled (startup scripts)
20
+ devzone is-enabled <module> code 0 if enabled
22
21
  devzone test-bash32 run the bats tests under bash 3.2 (Docker container)
23
22
  devzone test-gitlab end-to-end test of the GitLab module and platform
24
23
  devzone agent <folder> <instructions> drive opencode with the instructions file
@@ -36,7 +35,7 @@ devzone_aide() {
36
35
  devzone argocd status|relay-start|relay-stop Argo CD (argocd module)
37
36
  devzone argocd app add <repo url> [path]|list|remove <N> projects deployed by Argo CD (#516)
38
37
  devzone cluster [CTX] [--yes] [--confirm CTX] services cluster of devzone, or change it
39
- devzone port [<n>|--close <n>] relay of a container port to the workstation
38
+ devzone port [--close <n>] list or remove a relay of the workstation
40
39
  devzone passwords regenerate .password and print its path
41
40
  devzone packages [add|remove|apply] … system packages kept after a rebuild
42
41
  Old French names are refused and print the new name (see the reference).
@@ -2,7 +2,7 @@
2
2
  # Network isolation and access authorization between devzone namespaces.
3
3
  # File <= 250 lines: functions namespace_isolate, allow, forbid.
4
4
  # These functions modify NetworkPolicies in the Kubernetes cluster.
5
- # Loaded by argocd.sh, catalog.sh, mysql.sh, gitlab.sh and postgres.sh; shipped with the package.
5
+ # Loaded by argocd.sh, catalog.sh, the mysql and postgres Go modules, gitlab.sh; shipped with the package.
6
6
 
7
7
  # Sets an isolating NetworkPolicy in a namespace.
8
8
  # Only the pods of the same namespace can reach the services.