devzone 1.1.0 → 3.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 (118) hide show
  1. package/.devcontainer/Dockerfile +4 -4
  2. package/.devcontainer/{agent-erreurs.sh → agent-errors.sh} +6 -6
  3. package/.devcontainer/agent-local.sh +2 -2
  4. package/.devcontainer/{agent-modele.messages → agent-model.messages} +1 -1
  5. package/.devcontainer/{agent-modele.sh → agent-model.sh} +5 -5
  6. package/.devcontainer/agent-pod-manifest.sh +4 -4
  7. package/.devcontainer/{agent-droits.sh → agent-rights.sh} +2 -2
  8. package/.devcontainer/agent-session.sh +3 -3
  9. package/.devcontainer/{agent-etat-json.sh → agent-state-json.sh} +6 -6
  10. package/.devcontainer/agent-workspace.sh +1 -1
  11. package/.devcontainer/agent.sh +14 -14
  12. package/.devcontainer/{ia/docker-garde.sh → ai/docker-guard.sh} +1 -1
  13. package/.devcontainer/{ia → ai}/host-models.sh +2 -2
  14. package/.devcontainer/{ia/plugins/devzone-garde-v2.js → ai/plugins/devzone-guard-v2.js} +7 -7
  15. package/.devcontainer/{ia/plugins/devzone-garde.js → ai/plugins/devzone-guard.js} +6 -6
  16. package/.devcontainer/argocd/argocd.sh +94 -93
  17. package/.devcontainer/argocd/{catalogue-argocd.sh → catalog-argocd.sh} +3 -3
  18. package/.devcontainer/argocd/services-hook.sh +8 -8
  19. package/.devcontainer/argocd/services.sh +1 -1
  20. package/.devcontainer/catalog/app.sh +209 -0
  21. package/.devcontainer/catalog/catalog-watcher.sh +130 -0
  22. package/.devcontainer/{catalogue → catalog}/mysql/app.conf +1 -1
  23. package/.devcontainer/catalog/mysql/install.sh +87 -0
  24. package/.devcontainer/catalog/mysql/mysql.sh +262 -0
  25. package/.devcontainer/catalog/mysql/volume.sh +71 -0
  26. package/.devcontainer/catalog.sh +231 -0
  27. package/.devcontainer/chart-direct.sh +1 -1
  28. package/.devcontainer/cluster.sh +222 -224
  29. package/.devcontainer/clusters.sh +41 -41
  30. package/.devcontainer/devcontainer.json +1 -1
  31. package/.devcontainer/devzone +103 -1506
  32. package/.devcontainer/devzone-ai-guard.sh +76 -0
  33. package/.devcontainer/devzone-ai.sh +201 -0
  34. package/.devcontainer/devzone-cluster.sh +210 -0
  35. package/.devcontainer/devzone-modules.sh +126 -0
  36. package/.devcontainer/devzone-platform.sh +189 -0
  37. package/.devcontainer/devzone-repair.sh +94 -0
  38. package/.devcontainer/devzone-services.sh +241 -0
  39. package/.devcontainer/devzone-skill.sh +97 -0
  40. package/.devcontainer/devzone-status.sh +140 -0
  41. package/.devcontainer/devzone-version.sh +78 -0
  42. package/.devcontainer/git-identity.sh +28 -0
  43. package/.devcontainer/gitlab/argocd.sh +2 -2
  44. package/.devcontainer/gitlab/chart.sh +2 -2
  45. package/.devcontainer/gitlab/gitlab.sh +83 -84
  46. package/.devcontainer/gitlab/installation.sh +111 -111
  47. package/.devcontainer/gitlab/secrets.sh +47 -47
  48. package/.devcontainer/gitlab/seed.sh +77 -77
  49. package/.devcontainer/gitlab/test-gitlab.sh +242 -243
  50. package/.devcontainer/help.sh +1 -1
  51. package/.devcontainer/isolation.sh +65 -0
  52. package/.devcontainer/kind-wrapper.sh +45 -0
  53. package/.devcontainer/kube-account.sh +199 -0
  54. package/.devcontainer/kube-config.sh +45 -46
  55. package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
  56. package/.devcontainer/kube-reachable.sh +64 -0
  57. package/.devcontainer/{memoire.sh → memory.sh} +1 -1
  58. package/.devcontainer/metrics-server.sh +2 -2
  59. package/.devcontainer/opencode.jsonc +2 -2
  60. package/.devcontainer/packages.sh +228 -0
  61. package/.devcontainer/password.sh +1 -1
  62. package/.devcontainer/ports-auto.sh +152 -153
  63. package/.devcontainer/ports-json.sh +16 -15
  64. package/.devcontainer/ports.sh +127 -123
  65. package/.devcontainer/post-create.sh +52 -52
  66. package/.devcontainer/postgres/postgres.sh +176 -176
  67. package/.devcontainer/rename-legacy-files.sh +103 -0
  68. package/.devcontainer/services-admin.sh +5 -5
  69. package/.devcontainer/skills/devzone/SKILL.md +40 -41
  70. package/.devcontainer/startup.sh +65 -0
  71. package/.devcontainer/{etat-gitops.sh → state-gitops.sh} +1 -1
  72. package/.devcontainer/{etat-json.sh → state-json.sh} +39 -65
  73. package/.devcontainer/{etat-verrou.sh → state-lock.sh} +1 -1
  74. package/.devcontainer/{etat.sh → state.sh} +4 -4
  75. package/.devcontainer/workspace-init.sh +17 -3
  76. package/Makefile +8 -8
  77. package/README.md +195 -194
  78. package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
  79. package/manage/devzone +8 -10
  80. package/manage/scripts/argocd-workspace.sh +1 -1
  81. package/manage/scripts/check-go-layout.sh +40 -0
  82. package/manage/scripts/check-names.sh +61 -0
  83. package/manage/scripts/create-cluster.sh +1 -1
  84. package/manage/scripts/create-mode.sh +2 -2
  85. package/manage/scripts/devzone-create.sh +5 -5
  86. package/manage/scripts/devzone-manifest.sh +3 -3
  87. package/manage/scripts/devzone-update.sh +12 -8
  88. package/manage/scripts/docker-workstation.sh +2 -2
  89. package/manage/scripts/docker.sh +2 -2
  90. package/manage/scripts/{lancer.sh → launch.sh} +10 -51
  91. package/manage/scripts/{migrer-retour.sh → migrate-revert.sh} +4 -4
  92. package/manage/scripts/{migrer.sh → migrate.sh} +8 -14
  93. package/manage/scripts/ports-apps.sh +1 -1
  94. package/manage/scripts/ports-workspace.sh +7 -7
  95. package/manage/scripts/{desinstaller.sh → uninstall.sh} +8 -8
  96. package/manage/scripts/workspace-egress.sh +2 -2
  97. package/manage/scripts/workspace-update.sh +5 -2
  98. package/manage/scripts/workspace-wait.sh +2 -2
  99. package/manage/workspace.sh +4 -4
  100. package/package.json +1 -1
  101. package/.devcontainer/catalogue/app.sh +0 -211
  102. package/.devcontainer/catalogue/catalogue-veilleur.sh +0 -130
  103. package/.devcontainer/catalogue/mysql/installer.sh +0 -87
  104. package/.devcontainer/catalogue/mysql/mysql.sh +0 -262
  105. package/.devcontainer/catalogue/mysql/volume.sh +0 -71
  106. package/.devcontainer/catalogue.sh +0 -231
  107. package/.devcontainer/demarrage.sh +0 -66
  108. package/.devcontainer/docker-relais.sh +0 -149
  109. package/.devcontainer/docker-sans-hote.sh +0 -12
  110. package/.devcontainer/git-identite.sh +0 -28
  111. package/.devcontainer/isolement.sh +0 -65
  112. package/.devcontainer/kind-enveloppe.sh +0 -45
  113. package/.devcontainer/kube-compte.sh +0 -200
  114. package/.devcontainer/kube-joignable.sh +0 -64
  115. package/.devcontainer/paquets.sh +0 -227
  116. /package/.devcontainer/{ia/docker-garde.message → ai/docker-guard.message} +0 -0
  117. /package/.devcontainer/{ia → ai}/host-check.message +0 -0
  118. /package/.devcontainer/{ia → ai}/host-check.sh +0 -0
@@ -163,7 +163,7 @@ spec:
163
163
  - name: DEVZONE_VERSION
164
164
  value: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
165
165
  # Root of the devzone projects in the Kubernetes workspace (#503)
166
- - name: DEVZONE_RACINE
166
+ - name: DEVZONE_ROOT
167
167
  value: /workspaces/projets
168
168
  # Global npm prefix, stored on the mounted state volume (#503)
169
169
  - name: NPM_CONFIG_PREFIX
package/manage/devzone CHANGED
@@ -6,7 +6,7 @@
6
6
  # devzone --version | --help
7
7
  # In the container, « devzone » is another command: the modules
8
8
  # (.devcontainer/devzone).
9
- # DEVZONE_SANS_DEMARRER=1: copy only, without starting the container (tests).
9
+ # DEVZONE_NO_START=1: copy only, without starting the container (tests).
10
10
  # The helpers live in manage/scripts/devzone-*.sh, sourced by the command that
11
11
  # needs them (so --version and --help work with this file alone).
12
12
  # shellcheck disable=SC2034 # PACKAGE_ITEMS, GITIGNORE_LINES: read by the sourced devzone-*.sh
@@ -31,11 +31,9 @@ GITIGNORE_LINES=(
31
31
  '!workspace/.gitkeep'
32
32
  '.DS_Store'
33
33
  '.devzone.log'
34
- '.devzone.etat'
34
+ '.devzone.state'
35
35
  '.password'
36
- '.devzone.sauvegarde/'
37
- '.devcontainer/sans-docker-hote/'
38
- '.devcontainer/without-host-docker/'
36
+ '.devzone.backup/'
39
37
  )
40
38
 
41
39
  # Version of the package (package.json next to manage/)
@@ -69,7 +67,7 @@ devzone $(version) : environnement de développement conteneurisé
69
67
  services (gitlab, postgres, argocd) du workspace Kubernetes
70
68
  devzone workspace argocd status|init|apply|app add|list|remove
71
69
  Argo CD du workspace : dépôt GitOps, .argocd.conf, projets
72
- (anciens noms français : refusés avec le nouveau nom, voir README, « Noms retirés »)
70
+ (old French names: refused with the new name, see the README, « Removed names »)
73
71
  devzone --version
74
72
  EOT
75
73
  }
@@ -109,19 +107,19 @@ case "${1:-}" in
109
107
  update_workstation "${@:2}"
110
108
  ;;
111
109
  uninstall)
112
- # Devzone folder (.devcontainer/); an older devzone has its desinstaller.sh
110
+ # Devzone folder (.devcontainer/); an older devzone has its uninstall.sh
113
111
  # in manage/scripts/ (new), core/scripts or scripts/ (old), or at the root
114
112
  uninstaller=""
115
113
  if [ -d .devcontainer ]; then
116
- for f in manage/scripts/desinstaller.sh core/scripts/desinstaller.sh scripts/desinstaller.sh desinstaller.sh; do
114
+ for f in manage/scripts/uninstall.sh core/scripts/uninstall.sh scripts/uninstall.sh uninstall.sh; do
117
115
  if [ -f "$f" ]; then uninstaller="$f" && break; fi
118
116
  done
119
117
  fi
120
118
  if [ -z "$uninstaller" ]; then
121
- echo "✖ À lancer dans un dossier devzone (desinstaller.sh introuvable ici)." >&2
119
+ echo "✖ À lancer dans un dossier devzone (uninstall.sh introuvable ici)." >&2
122
120
  exit 1
123
121
  fi
124
- DEVZONE_COMMANDE="devzone uninstall" bash "$uninstaller"
122
+ DEVZONE_COMMAND="devzone uninstall" bash "$uninstaller"
125
123
  ;;
126
124
  workspace)
127
125
  bash "$PAQUET/manage/workspace.sh" "${@:2}"
@@ -131,7 +131,7 @@ argocd_save_admin_password() {
131
131
 
132
132
  # .password of the workstation regenerated from workspace/.*/ (password.sh of the package)
133
133
  argocd_passwords_refresh() {
134
- DEVZONE_RACINE="$PWD" bash "$RACINE/.devcontainer/password.sh" regenerer 2>/dev/null ||
134
+ DEVZONE_ROOT="$PWD" bash "$RACINE/.devcontainer/password.sh" regenerer 2>/dev/null ||
135
135
  echo "⚠ .password not updated (bash .devcontainer/password.sh regenerer)" >&2
136
136
  }
137
137
 
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+ # CI check: every Go file has at most 250 lines, tests included (#710). A file
3
+ # that grows beyond it is split into a folder of smaller files, by
4
+ # responsibility. Checked: the Go files tracked by git, plus the new ones not
5
+ # ignored (git ls-files --cached --others --exclude-standard), so the Go
6
+ # projects checked out under workspace/ are never counted. A file too long is
7
+ # printed as "path: N lines (max 250)" and the run exits 1; otherwise it prints
8
+ # "go layout: N files ok" and exits 0. bash 3.2 (macOS).
9
+
10
+ set -u
11
+
12
+ ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ ROOT="$(cd "$ICI/../.." && pwd)"
14
+ MAX=250
15
+
16
+ if ! files="$(git -C "$ROOT" ls-files --cached --others --exclude-standard -- '*.go')"; then
17
+ echo "check-go-layout: git ls-files fails in $ROOT" >&2
18
+ exit 1
19
+ fi
20
+
21
+ fails=0
22
+ count=0
23
+ while IFS= read -r f; do
24
+ [ -n "$f" ] || continue
25
+ [ -f "$ROOT/$f" ] || continue
26
+ count=$((count + 1))
27
+ # awk counts the last line too, even without a final newline
28
+ lines="$(awk 'END { print NR }' "$ROOT/$f")"
29
+ if [ "$lines" -gt "$MAX" ]; then
30
+ printf '%s: %s lines (max %s)\n' "$f" "$lines" "$MAX"
31
+ fails=1
32
+ fi
33
+ done <<LISTE
34
+ $files
35
+ LISTE
36
+
37
+ if [ "$fails" -ne 0 ]; then
38
+ exit 1
39
+ fi
40
+ echo "go layout: $count files ok"
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ # CI check: the names of the files and folders tracked by git are in English
3
+ # (#716). A path fails when one of its words (split on - . _ and /) is in the
4
+ # list of French words below. Each fault is printed as "path: word" and the
5
+ # run exits 1; otherwise it prints "names check: N paths ok" and exits 0.
6
+ # Not checked: .github/ (the workflow names are referenced by the repowarden
7
+ # checks) and the names listed in ALLOWED (user data kept under its name, and
8
+ # the migration script, which must hold the former names). bash 3.2 (macOS).
9
+
10
+ set -u
11
+
12
+ ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ ROOT="$(cd "$ICI/../.." && pwd)"
14
+
15
+ # French words that must not appear in a name. Split fragments, so this file
16
+ # does not match its own rules (the check-english convention).
17
+ FRENCH=" cre_er desinst_aller migr_er ret_our et_at demarr_age catalog_ue paqu_ets plate_forme memo_ire rel_ais verr_ou veill_eur dro_its err_eurs mod_ele mod_eles ec_arts chem_ins para_llele ho_te san_s ave_c envel_oppe join_gnable isole_ment comp_te lan_cer rep_arer util_iser garde_ mett_re identi_te invi_te "
18
+ FRENCH="$(printf '%s' "$FRENCH" | tr -d '_')"
19
+
20
+ # Names of the user data kept as they are, and the migration script (#733, it
21
+ # holds the former names to rename them)
22
+ ALLOWED=" .devzone.modules .devzone.version .devcontainer/rename-legacy-files.sh "
23
+
24
+ if ! paths="$(git -C "$ROOT" ls-files --cached --others --exclude-standard)"; then
25
+ echo "check-names: git ls-files fails in $ROOT" >&2
26
+ exit 1
27
+ fi
28
+
29
+ fails=0
30
+ count=0
31
+ while IFS= read -r path; do
32
+ [ -n "$path" ] || continue
33
+ case "$path" in
34
+ .github/*) continue ;;
35
+ esac
36
+ count=$((count + 1))
37
+ words="$(printf '%s' "$path" | tr '/._-' ' ')"
38
+ for word in $words; do
39
+ case "$FRENCH" in
40
+ *" $word "*)
41
+ skip=0
42
+ for allowed in $ALLOWED; do
43
+ case "$path" in
44
+ "$allowed" | "$allowed"/*) skip=1 ;;
45
+ esac
46
+ done
47
+ if [ "$skip" -eq 0 ]; then
48
+ printf '%s: %s\n' "$path" "$word"
49
+ fails=1
50
+ fi
51
+ ;;
52
+ esac
53
+ done
54
+ done <<LISTE
55
+ $paths
56
+ LISTE
57
+
58
+ if [ "$fails" -ne 0 ]; then
59
+ exit 1
60
+ fi
61
+ echo "names check: $count paths ok"
@@ -81,7 +81,7 @@ create_cluster_minikube() {
81
81
  printf 'Create it now? [y/N] '
82
82
  read -r answer || answer=""
83
83
  case "$answer" in
84
- y | Y | yes | o | O | oui) ;;
84
+ y | Y | yes) ;;
85
85
  *) echo "✖ cancelled" >&2; return 1 ;;
86
86
  esac
87
87
  minikube start -p devzone || { echo "✖ minikube start failed: nothing else done" >&2; return 1; }
@@ -94,10 +94,10 @@ create_mode_write() {
94
94
 
95
95
  # Kubernetes creation: installs the workspace from the package script, run in
96
96
  # the new folder (as devzone workspace start does). DEVZONE_WORKSPACE_SH
97
- # replaces the script (tests); DEVZONE_SANS_DEMARRER only prints the command.
97
+ # replaces the script (tests); DEVZONE_NO_START only prints the command.
98
98
  create_mode_start() {
99
99
  local folder="$1" script="$2"
100
- if [ -n "${DEVZONE_SANS_DEMARRER:-}" ]; then
100
+ if [ -n "${DEVZONE_NO_START:-}" ]; then
101
101
  echo "To start the workspace: cd $folder && devzone workspace start"
102
102
  return 0
103
103
  fi
@@ -18,8 +18,8 @@ ask_gitops() {
18
18
  read -r answer || answer=""
19
19
  answer="${answer:-$default}"
20
20
  case "$answer" in
21
- G | g | GitHub | github | Oui | oui | OUI) echo "github" ;;
22
- n | N | none | None | Non | non | NON | aucun | Aucun) echo "none" ;;
21
+ G | g | GitHub | github | y | Y | yes) echo "github" ;;
22
+ n | N | none | None) echo "none" ;;
23
23
  *) echo "$answer" ;;
24
24
  esac
25
25
  }
@@ -72,7 +72,7 @@ create_workstation() {
72
72
  # npm never includes .gitignore: written here
73
73
  : >"$target/.gitignore"
74
74
  complete_gitignore "$target"
75
- chmod +x "$target/manage/scripts/desinstaller.sh" "$target/manage/scripts/lancer.sh"
75
+ chmod +x "$target/manage/scripts/uninstall.sh" "$target/manage/scripts/launch.sh"
76
76
  create_mode_write "$target" "$CREATE_MODE"
77
77
  # The GitOps repository of the new devzone (#539): github, an existing URL,
78
78
  # or none, written in the .argocd.conf of the new devzone (conf.sh writes
@@ -117,7 +117,7 @@ create_workstation() {
117
117
  create_mode_start "$target" "$PAQUET/manage/workspace.sh"
118
118
  return
119
119
  fi
120
- if [ -n "${DEVZONE_SANS_DEMARRER:-}" ]; then
120
+ if [ -n "${DEVZONE_NO_START:-}" ]; then
121
121
  echo "Pour le lancer : cd $target && make up"
122
122
  return 0
123
123
  fi
@@ -132,7 +132,7 @@ create_workstation() {
132
132
  if command -v make >/dev/null 2>&1; then
133
133
  make -C "$target" up
134
134
  else
135
- bash "$target/manage/scripts/lancer.sh" up "$target"
135
+ bash "$target/manage/scripts/launch.sh" up "$target"
136
136
  fi
137
137
  echo "Ensuite : cd $target && make shell (ou ouvre le dossier dans VS Code : Reopen in Container)."
138
138
  }
@@ -122,7 +122,7 @@ inside_folder() {
122
122
  is_protected() {
123
123
  case "$1" in
124
124
  workspace | workspace/* | .devzone.version | .devzone.modules | .devzone.modules-* | \
125
- .devzone.paquets | .password | .app | .devzone.log | .git | .git/*) return 0 ;;
125
+ .devzone.packages | .password | .app | .devzone.log | .git | .git/*) return 0 ;;
126
126
  esac
127
127
  return 1
128
128
  }
@@ -139,10 +139,10 @@ old_tree() {
139
139
  local folder="$1" tree="$2"
140
140
  case "$tree" in
141
141
  core)
142
- [ -f "$folder/core/devzone" ] || [ -f "$folder/core/scripts/desinstaller.sh" ]
142
+ [ -f "$folder/core/devzone" ] || [ -f "$folder/core/scripts/uninstall.sh" ]
143
143
  ;;
144
144
  scripts)
145
- [ -f "$folder/scripts/desinstaller.sh" ] && [ -f "$folder/scripts/lancer.sh" ]
145
+ [ -f "$folder/scripts/uninstall.sh" ] && [ -f "$folder/scripts/launch.sh" ]
146
146
  ;;
147
147
  *) return 1 ;;
148
148
  esac
@@ -116,13 +116,13 @@ update_workstation() {
116
116
  done <"$work/modified"
117
117
  if [ -z "$assume_yes" ]; then
118
118
  if [ ! -t 0 ]; then
119
- echo "✖ Fichiers modifiés localement : relance avec --yes pour les remplacer (sauvegarde dans .devzone.sauvegarde/)." >&2
119
+ echo "✖ Fichiers modifiés localement : relance avec --yes pour les remplacer (sauvegarde dans .devzone.backup/)." >&2
120
120
  exit 1
121
121
  fi
122
- printf 'Remplacer ces fichiers (sauvegarde dans .devzone.sauvegarde/) ? [o/N] ' >&2
122
+ printf 'Replace these files (backup in .devzone.backup/)? [y/N] ' >&2
123
123
  read -r answer || answer=""
124
124
  case "$answer" in
125
- o | O | oui | Oui | OUI) ;;
125
+ y | Y | yes) ;;
126
126
  *)
127
127
  echo "Abandon : rien n'a été modifié."
128
128
  return 1
@@ -131,9 +131,13 @@ update_workstation() {
131
131
  fi
132
132
  fi
133
133
 
134
+ # Former French names renamed before the backup (#733): the backup folder is
135
+ # .devzone.backup. The script comes from the package, the folder may be old
136
+ DEVZONE_ROOT="$folder" bash "$PAQUET/.devcontainer/rename-legacy-files.sh" || true
137
+
134
138
  # 3. Backup of every file replaced or removed
135
139
  if [ -s "$work/to_save" ]; then
136
- base="$folder/.devzone.sauvegarde/$(date +%Y%m%d-%H%M%S)"
140
+ base="$folder/.devzone.backup/$(date +%Y%m%d-%H%M%S)"
137
141
  backup="$base"
138
142
  n=1
139
143
  while [ -e "$backup" ]; do
@@ -205,17 +209,17 @@ update_workstation() {
205
209
  echo "Reconstruction : make -C $folder rebuild (à lancer dans un terminal)"
206
210
  return 0
207
211
  fi
208
- printf 'Reconstruire le conteneur maintenant (make rebuild) ? [o/N] ' >&2
212
+ printf 'Rebuild the container now (make rebuild)? [y/N] ' >&2
209
213
  read -r answer || answer=""
210
214
  case "$answer" in
211
- o | O | oui | Oui | OUI) ;;
215
+ y | Y | yes) ;;
212
216
  *)
213
217
  echo "Reconstruction non lancée : make -C $folder rebuild"
214
218
  return 0
215
219
  ;;
216
220
  esac
217
- if [ -n "${DEVZONE_RECONSTRUIRE:-}" ]; then
218
- sh -c "$DEVZONE_RECONSTRUIRE"
221
+ if [ -n "${DEVZONE_REBUILD:-}" ]; then
222
+ sh -c "$DEVZONE_REBUILD"
219
223
  else
220
224
  make -C "$folder" rebuild
221
225
  fi
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # Docker workstation put to sleep when the Kubernetes workspace takes over (#517).
3
- # Sourced by migrer.sh (stop) and migrer-retour.sh (start). Containers of the
3
+ # Sourced by migrate.sh (stop) and migrate-revert.sh (start). Containers of the
4
4
  # workstation folder (label devcontainer.local_folder) and the automatic port
5
5
  # relays of this instance (labels devzone.auto=true, devzone.instance) are
6
6
  # stopped, never removed. Without Docker,
@@ -12,7 +12,7 @@ docker_workstation_ready() {
12
12
  }
13
13
 
14
14
  # Ids, one per line, of the containers of folder $1 and of the automatic relays
15
- # of this instance (DEVZONE_VOLUMES, default devzone, as in desinstaller.sh): the
15
+ # of this instance (DEVZONE_VOLUMES, default devzone, as in uninstall.sh): the
16
16
  # relays of another devzone on the same machine are not touched.
17
17
  # $2 is "running" (docker ps) or "exited" (stopped containers, docker ps -a).
18
18
  docker_workstation_ids() {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
- # Checks Docker on the host before any call (sourced by lancer.sh,
3
- # desinstaller.sh and the npm command manage/devzone): without it the user
2
+ # Checks Docker on the host before any call (sourced by launch.sh,
3
+ # uninstall.sh and the npm command manage/devzone): without it the user
4
4
  # would only see the raw devcontainers CLI or docker error.
5
5
  # DEVZONE_DOCKER: docker command name (tests: simulate its absence).
6
6
  # Compatible with bash 3.2 (macOS).
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  # Starts the container on the host without ever staying silent:
3
- # bash manage/scripts/lancer.sh up [folder] (make up)
4
- # bash manage/scripts/lancer.sh rebuild [folder] (make rebuild: rebuild from scratch)
3
+ # bash manage/scripts/launch.sh up [folder] (make up)
4
+ # bash manage/scripts/launch.sh rebuild [folder] (make rebuild: rebuild from scratch)
5
5
  # Full devcontainer CLI output goes to <folder>/.devzone.log; the terminal shows
6
- # key steps, a heartbeat at least every DEVZONE_SIGNE_DE_VIE seconds (30), and a
6
+ # key steps, a heartbeat at least every DEVZONE_HEARTBEAT seconds (30), and a
7
7
  # question asked inside the container (last log line left unanswered for
8
- # DEVZONE_ATTENTE_QUESTION seconds, 20) is shown and startup is stopped: nobody
8
+ # DEVZONE_QUESTION_WAIT seconds, 20) is shown and startup is stopped: nobody
9
9
  # can answer it (the CLI runs without input), waiting would hang forever.
10
10
  # Portable: bash 3.2 (macOS) and Linux.
11
11
  set -uo pipefail
@@ -16,55 +16,14 @@ case "$mode" in
16
16
  up) options=() done_msg="devzone started" ;;
17
17
  rebuild) options=(--remove-existing-container) done_msg="devzone rebuilt" ;;
18
18
  *)
19
- echo "usage: bash manage/scripts/lancer.sh up|rebuild [folder]" >&2
19
+ echo "usage: bash manage/scripts/launch.sh up|rebuild [folder]" >&2
20
20
  exit 2
21
21
  ;;
22
22
  esac
23
23
 
24
- # Host Docker socket (#432): docker-hote line in instance state, written by devzone
25
- # inside the container. Missing or on: historical behavior.
26
- host_off() {
27
- local v
28
- v="$(grep -E '^docker-hote=' "$FOLDER/.devzone.modules" 2>/dev/null | tail -1 | cut -d= -f2 || true)"
29
- [ "$v" = off ]
30
- }
31
-
32
- # Copy of devcontainer.json without the docker-outside-of-docker feature, for a
33
- # container without the host socket. The file lives one level deeper: build
34
- # paths go up one level (../). Written at each start, in a git-ignored folder;
35
- # comments from the original JSON are kept.
36
- # shellcheck disable=SC2034
37
- generate_config_without_host_docker() {
38
- local folder="$FOLDER/.devcontainer/without-host-docker" context=no
39
- grep -q '"context"' "$FOLDER/.devcontainer/devcontainer.json" && context=yes
40
- mkdir -p "$folder"
41
- awk -v context="$context" '
42
- /ghcr\.io\/devcontainers\/features\/docker-outside-of-docker/ { next }
43
- /"build"[[:space:]]*:[[:space:]]*\{[[:space:]]*"dockerfile"[[:space:]]*:[[:space:]]*"Dockerfile"[[:space:]]*\}/ {
44
- sub(/\{[[:space:]]*"dockerfile"[[:space:]]*:[[:space:]]*"Dockerfile"[[:space:]]*\}/,
45
- "{ \"dockerfile\": \"../Dockerfile\", \"context\": \"..\" }")
46
- print
47
- next
48
- }
49
- context == "no" && /"build"[[:space:]]*:[[:space:]]*\{[[:space:]]*$/ {
50
- print
51
- print " \"context\": \"..\","
52
- next
53
- }
54
- /"dockerfile"[[:space:]]*:/ {
55
- sub(/"dockerfile"[[:space:]]*:[[:space:]]*"[^"]*"/, "\"dockerfile\": \"../Dockerfile\"")
56
- }
57
- { print }
58
- ' "$FOLDER/.devcontainer/devcontainer.json" >"$folder/devcontainer.json"
59
- }
60
-
61
- if host_off; then
62
- generate_config_without_host_docker
63
- options+=(--config "$FOLDER/.devcontainer/without-host-docker/devcontainer.json")
64
- fi
65
24
  LOG="$FOLDER/.devzone.log"
66
- HEARTBEAT="${DEVZONE_SIGNE_DE_VIE:-30}"
67
- QUESTION_WAIT="${DEVZONE_ATTENTE_QUESTION:-20}"
25
+ HEARTBEAT="${DEVZONE_HEARTBEAT:-30}"
26
+ QUESTION_WAIT="${DEVZONE_QUESTION_WAIT:-20}"
68
27
  ESC="$(printf '\033')"
69
28
 
70
29
  # Readable log line: without color codes or carriage returns
@@ -73,7 +32,7 @@ clean_line() { sed "s/${ESC}\[[0-9;?]*[A-Za-z]//g" | tr -d '\r'; }
73
32
  last_line() { tail -c 2000 "$LOG" | clean_line | grep -v '^[[:space:]]*$' | tail -1 | cut -c1-110; }
74
33
 
75
34
  # Pending question: last unfinished line (no newline, like a prompt) ending with
76
- # [o/N], [y/N], ? or a password prompt
35
+ # [y/N], ? or a password prompt
77
36
  pattern='(\[[^]]*/[^]]*\]|\?|[Pp]assword[^:]*:|[Mm]ot de passe[^:]*:)[[:space:]]*$'
78
37
  pending_question() {
79
38
  local line
@@ -97,7 +56,7 @@ show_steps() {
97
56
  *"Start: Run: docker run"*) announce container "Creating container" ;;
98
57
  *"Running the postCreateCommand"*) announce postcreate "Installing in container (repowarden, modules)" ;;
99
58
  *"Running the postStartCommand"*) announce poststart "Starting (git identity, clusters, state)" ;;
100
- "devzone ready"* | "devzone started"* | "devzone rebuilt"* | "devzone : "* | "devzone: "* | " ✔ "* | " ✖ "* | " ○ "* | " ⚠ "* | " "[!\ ]* | "git-identite : "* | "kube-config : "* | "metrics-server : "*)
59
+ "devzone ready"* | "devzone started"* | "devzone rebuilt"* | "devzone : "* | "devzone: "* | " ✔ "* | " ✖ "* | " ○ "* | " ⚠ "* | " "[!\ ]* | "git-identity : "* | "kube-config : "* | "metrics-server : "*)
101
60
  echo " $line"
102
61
  last_announce="$(date +%s)"
103
62
  ;;
@@ -124,7 +83,7 @@ trap 'stop_launch; echo; echo "interrupted - log: .devzone.log"; exit 130' INT T
124
83
  # Docker first: without it the CLI would only show a raw JSON error
125
84
  # shellcheck source=SCRIPTDIR/docker.sh
126
85
  . "$(dirname "${BASH_SOURCE[0]}")/docker.sh"
127
- docker_ready "${DEVZONE_COMMANDE:-make $mode}" || exit 1
86
+ docker_ready "${DEVZONE_COMMAND:-make $mode}" || exit 1
128
87
 
129
88
  : >"$LOG"
130
89
  start="$(date +%s)"
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env bash
2
2
  # Rollback from Kubernetes workspace to Docker workstation (#403): devzone workspace
3
- # revert [--bring-back]. Sourced by manage/workspace.sh after migrer.sh (uses
3
+ # revert [--bring-back]. Sourced by manage/workspace.sh after migrate.sh (uses
4
4
  # copy_from, record_workspace, fail and kc). With --bring-back, the workstation
5
- # version of a project is moved to .devzone.sauvegarde/<date>/ before being replaced.
5
+ # version of a project is moved to .devzone.backup/<date>/ before being replaced.
6
6
 
7
7
  # Backup folder for this run (relative to devzone), same convention as
8
- # devzone update: .devzone.sauvegarde/<YYYYMMDD-HHMMSS>, -n suffix if taken.
8
+ # devzone update: .devzone.backup/<YYYYMMDD-HHMMSS>, -n suffix if taken.
9
9
  backup_folder() {
10
10
  local base folder n=1
11
- base=".devzone.sauvegarde/$(date +%Y%m%d-%H%M%S)"
11
+ base=".devzone.backup/$(date +%Y%m%d-%H%M%S)"
12
12
  folder="$base"
13
13
  while [ -e "$folder" ]; do
14
14
  n=$((n + 1))
@@ -4,13 +4,13 @@
4
4
  # kubectl_flag, copy_to and copy_from. Nothing is ever deleted except by
5
5
  # clean-docker, after confirmation. Run from the devzone workstation folder.
6
6
 
7
- # Docker workstation sleep on migrate (stop here, start in migrer-retour.sh).
7
+ # Docker workstation sleep on migrate (stop here, start in migrate-revert.sh).
8
8
  # shellcheck source=manage/scripts/docker-workstation.sh
9
9
  . "$(dirname "${BASH_SOURCE[0]}")/docker-workstation.sh"
10
10
 
11
11
  # vscode home in the pod and image used to copy Docker volumes.
12
12
  POD_HOME="/home/vscode"
13
- COPY_IMAGE="${DEVZONE_IMAGE_COPIE:-busybox:1.36}"
13
+ COPY_IMAGE="${DEVZONE_IMAGE_COPY:-busybox:1.36}"
14
14
  # Docker workstation volumes: devzone-<x>, or $DEVZONE_VOLUMES-<x> (functional tests).
15
15
  DOCKER_VOLUMES=(gh git claude opencode-config opencode-data agent config m2 gradle pnpm)
16
16
  # Folder size measurement ($1): "file count bytes".
@@ -73,7 +73,7 @@ confirm() {
73
73
  return 1
74
74
  fi
75
75
  read -r -p "$1 [y/N] " reply || true
76
- case "$reply" in y | Y | yes | YES | Yes | o | O | oui | OUI | Oui) return 0 ;; esac
76
+ case "$reply" in y | Y | yes | YES | Yes) return 0 ;; esac
77
77
  echo "✖ canceled, nothing changed" >&2
78
78
  return 1
79
79
  }
@@ -163,11 +163,13 @@ step_identities() {
163
163
  done
164
164
  }
165
165
 
166
- # Step 4: workstation .devzone.modules and .devzone.paquets copied to the pod.
166
+ # Step 4: workstation .devzone.modules and .devzone.packages copied to the pod.
167
167
  step_state() {
168
168
  local f
169
- echo "▶ [4/5] state: .devzone.modules and .devzone.paquets to $PROJECTS_DIR"
170
- for f in .devzone.modules .devzone.paquets; do
169
+ # Former French names renamed first (#733): the workstation folder may be old
170
+ DEVZONE_ROOT="$PWD" bash "$ROOT/.devcontainer/rename-legacy-files.sh" || true
171
+ echo "▶ [4/5] state: .devzone.modules and .devzone.packages to $PROJECTS_DIR"
172
+ for f in .devzone.modules .devzone.packages; do
171
173
  if [ ! -f "$f" ]; then
172
174
  echo " – $f: missing on workstation, skipped"
173
175
  continue
@@ -233,11 +235,3 @@ clean_docker() {
233
235
  echo " ✔ $v removed"
234
236
  done
235
237
  }
236
-
237
- # compatibility aliases, removed with lot 4 (#509)
238
- lire_option() { read_flag "$@"; }
239
- confirmer() { confirm "$@"; }
240
- noter_workspace() { record_workspace "$@"; }
241
- migrer() { migrate_workspace "$@"; }
242
- nettoyer_docker() { clean_docker "$@"; }
243
- echec() { fail "$@"; }
@@ -2,7 +2,7 @@
2
2
  # Applications of the Kubernetes workspace relayed on workstation localhost (#611).
3
3
  # Sourced by ports-workspace.sh, never run alone. One kubectl get svc -A per
4
4
  # round: each TCP port of each Service gets a local port, kept stable in
5
- # .devzone.ports-workspace/apps/<namespace>.<service>.<port> while the Service
5
+ # .devzone.workspace-ports/apps/<namespace>.<service>.<port> while the Service
6
6
  # exists. Only Services with a ready endpoint are relayed (#638): the others keep
7
7
  # their local port and show as "no ready pod" in status. Output lines:
8
8
  # "portlocal|namespace|svc/name|remoteport", as pw_services.
@@ -2,10 +2,10 @@
2
2
  # Applications and services of the Kubernetes workspace on workstation localhost (#401).
3
3
  # Sourced by manage/workspace.sh (ports_* functions); run directly with "loop" or
4
4
  # "round", it is the workstation watcher: only one, mkdir lock and pid in
5
- # .devzone.ports-workspace/. It relays with kubectl port-forward, on 127.0.0.1
5
+ # .devzone.workspace-ports/. It relays with kubectl port-forward, on 127.0.0.1
6
6
  # only, TCP ports >= 1024 listening in the pod, and devzone services of active
7
7
  # modules in .devzone.modules. Guard: never under bats without
8
- # DEVZONE_PORTS_WORKSPACE_REEL=oui.
8
+ # DEVZONE_PORTS_WORKSPACE_REAL=yes.
9
9
 
10
10
  PW_POD="devzone-workspace-0"
11
11
  PW_NS="devzone-workspace"
@@ -18,7 +18,7 @@ PW_JSONPATH='jsonpath={.spec.ports[0].port}'
18
18
  . "$(dirname "${BASH_SOURCE[0]}")/ports-apps.sh"
19
19
 
20
20
  # Watcher state folder: lock, pid, relays, reported ports, log.
21
- pw_dir() { printf '%s' "${DEVZONE_PORTS_WORKSPACE_DIR:-$PWD/.devzone.ports-workspace}"; }
21
+ pw_dir() { printf '%s' "${DEVZONE_PORTS_WORKSPACE_DIR:-$PWD/.devzone.workspace-ports}"; }
22
22
 
23
23
  # kubectl context flag: devzone if it exists, otherwise current context.
24
24
  pw_ctx() {
@@ -33,10 +33,10 @@ pw_kubectl() {
33
33
  kubectl $(pw_ctx) "$@"
34
34
  }
35
35
 
36
- # Guard: refuse under bats without DEVZONE_PORTS_WORKSPACE_REEL=oui (message if $1 empty).
36
+ # Guard: refuse under bats without DEVZONE_PORTS_WORKSPACE_REAL=yes (message if $1 empty).
37
37
  pw_guard() {
38
- if [ -n "${BATS_TEST_TMPDIR:-}" ] && [ "${DEVZONE_PORTS_WORKSPACE_REEL:-}" != oui ]; then
39
- [ -n "${1:-}" ] || echo "✖ port watcher refused under bats (DEVZONE_PORTS_WORKSPACE_REEL=oui required)" >&2
38
+ if [ -n "${BATS_TEST_TMPDIR:-}" ] && [ "${DEVZONE_PORTS_WORKSPACE_REAL:-}" != yes ]; then
39
+ [ -n "${1:-}" ] || echo "✖ port watcher refused under bats (DEVZONE_PORTS_WORKSPACE_REAL=yes required)" >&2
40
40
  return 2
41
41
  fi
42
42
  }
@@ -155,7 +155,7 @@ pw_loop() {
155
155
  trap 'pw_remove_all; rm -rf "$d/verrou" "$d/pid"; exit 0' TERM INT
156
156
  while :; do
157
157
  pw_round || true
158
- sleep "${DEVZONE_PORTS_WORKSPACE_PAS:-3}" &
158
+ sleep "${DEVZONE_PORTS_WORKSPACE_STEP:-3}" &
159
159
  wait $!
160
160
  done
161
161
  }
@@ -15,7 +15,7 @@ set -euo pipefail
15
15
  # devzone folder: two levels above the script (manage/scripts/), so the command
16
16
  # works when run from any folder
17
17
  HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
18
- STATE="$HERE/.devzone.etat"
18
+ STATE="$HERE/.devzone.state"
19
19
  KEEP="${KEEP:-${GARDER:-}}"
20
20
  LOGINS=(gh git claude opencode-config opencode-data config)
21
21
  LOCAL_CTX='^(kind-.*|docker-desktop|rancher-desktop|orbstack|minikube)$'
@@ -29,7 +29,7 @@ esac
29
29
  # Docker first: without it every docker call would show its raw error
30
30
  # shellcheck source=SCRIPTDIR/docker.sh
31
31
  . "$(dirname "${BASH_SOURCE[0]}")/docker.sh"
32
- docker_ready "${DEVZONE_COMMANDE:-make desinstaller}" || exit 1
32
+ docker_ready "${DEVZONE_COMMAND:-make desinstaller}" || exit 1
33
33
 
34
34
  # .argocd.conf of the devzone folder: the GitOps repository is never removed
35
35
  # with the devzone, only its designation can be changed later
@@ -52,10 +52,10 @@ fi
52
52
  # (DEVZONE_VOLUMES) is unknown here. Touching Docker from the container could
53
53
  # remove another instance's resources (or the default instance): only the
54
54
  # Kubernetes part is handled.
55
- # DEVZONE_DANS_CONTENEUR=yes|no forces the mode (tests, which run inside a container)
56
- case "${DEVZONE_DANS_CONTENEUR:-}" in
57
- oui | yes) INSIDE_CONTAINER=true ;;
58
- non | no) INSIDE_CONTAINER=false ;;
55
+ # DEVZONE_IN_CONTAINER=yes|no forces the mode (tests, which run inside a container)
56
+ case "${DEVZONE_IN_CONTAINER:-}" in
57
+ yes) INSIDE_CONTAINER=true ;;
58
+ no) INSIDE_CONTAINER=false ;;
59
59
  *) INSIDE_CONTAINER=false; [ ! -f /.dockerenv ] || INSIDE_CONTAINER=true ;;
60
60
  esac
61
61
 
@@ -168,14 +168,14 @@ if [ "$total" -eq 0 ]; then
168
168
  echo "✔ Nothing to remove."
169
169
  else
170
170
  CONFIRM_VALUE="${CONFIRM:-${CONFIRMER:-}}"
171
- if [ "$CONFIRM_VALUE" != yes ] && [ "$CONFIRM_VALUE" != oui ]; then
171
+ if [ "$CONFIRM_VALUE" != yes ]; then
172
172
  if [ ! -t 0 ]; then
173
173
  echo "✖ Cannot confirm without a terminal: CONFIRM=yes make desinstaller" >&2
174
174
  exit 1
175
175
  fi
176
176
  read -r -p "Permanently remove? Type yes: " answer
177
177
  case "$answer" in
178
- yes | oui) ;;
178
+ yes) ;;
179
179
  *) echo "Canceled: nothing was removed."; exit 0 ;;
180
180
  esac
181
181
  fi
@@ -36,11 +36,11 @@ egress_params() {
36
36
 
37
37
  # Waits for the proxy after the redeploy. Argo CD creates its Deployment a few
38
38
  # seconds to a minute after the sync: the Deployment is looked up every
39
- # DEVZONE_EGRESS_PAS s (3 by default) up to DEVZONE_EGRESS_WAIT s (90 by
39
+ # DEVZONE_EGRESS_STEP s (3 by default) up to DEVZONE_EGRESS_WAIT s (90 by
40
40
  # default); then its rollout is awaited for DEVZONE_EGRESS_ROLLOUT s (120 by
41
41
  # default). Returns 1 when either is not reached.
42
42
  egress_wait_proxy() {
43
- local limit="${DEVZONE_EGRESS_WAIT:-90}" rollout="${DEVZONE_EGRESS_ROLLOUT:-120}" pas="${DEVZONE_EGRESS_PAS:-3}" attendu=0
43
+ local limit="${DEVZONE_EGRESS_WAIT:-90}" rollout="${DEVZONE_EGRESS_ROLLOUT:-120}" pas="${DEVZONE_EGRESS_STEP:-3}" attendu=0
44
44
  until ak -n "$NAMESPACE" get deployment devzone-workspace-egress-proxy >/dev/null 2>&1; do
45
45
  if [ "$attendu" -ge "$limit" ]; then
46
46
  echo "⚠ the egress proxy was not created by Argo CD after $limit s: the setting is kept, check devzone workspace argocd status" >&2