devzone 4.3.0 → 6.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.
- package/.devcontainer/Dockerfile +1 -1
- package/.devcontainer/agent-errors.sh +13 -13
- package/.devcontainer/agent-local.sh +18 -18
- package/.devcontainer/agent-model.messages +7 -7
- package/.devcontainer/agent-model.sh +46 -46
- package/.devcontainer/agent-pod-manifest.sh +1 -1
- package/.devcontainer/agent-pod.sh +7 -7
- package/.devcontainer/agent-rights.sh +31 -31
- package/.devcontainer/agent-session.sh +22 -22
- package/.devcontainer/agent-state-json.sh +21 -21
- package/.devcontainer/agent-workspace.sh +8 -8
- package/.devcontainer/agent.sh +30 -30
- package/.devcontainer/ai/host-check.sh +2 -2
- package/.devcontainer/ai/host-models.sh +4 -4
- package/.devcontainer/ai/plugins/devzone-guard-v2.js +1 -1
- package/.devcontainer/ai/plugins/devzone-guard.js +1 -1
- package/.devcontainer/catalog/mysql/app.conf +1 -1
- package/.devcontainer/cluster.sh +1 -1
- package/.devcontainer/command-aliases.sh +34 -4
- package/.devcontainer/devzone +2 -2
- package/.devcontainer/devzone-ai.sh +4 -4
- package/.devcontainer/devzone-modules.sh +1 -1
- package/.devcontainer/devzone-skill.sh +1 -1
- package/.devcontainer/opencode.jsonc +1 -1
- package/.devcontainer/packages.sh +1 -1
- package/.devcontainer/post-create.sh +2 -0
- package/.devcontainer/rename-legacy-files.sh +71 -14
- package/.devcontainer/skills/devzone/SKILL.md +7 -7
- package/.devcontainer/state-json.sh +1 -1
- package/.devcontainer/state.sh +6 -6
- package/.devcontainer/workspace-init.sh +1 -1
- package/README.md +6 -6
- package/bin/SHA256SUMS +6 -6
- package/bin/devzone-darwin-amd64 +0 -0
- package/bin/devzone-darwin-arm64 +0 -0
- package/bin/devzone-linux-amd64 +0 -0
- package/bin/devzone-linux-arm64 +0 -0
- package/bin/devzone-windows-amd64.exe +0 -0
- package/bin/devzone-windows-arm64.exe +0 -0
- package/manage/devzone +17 -11
- package/manage/scripts/devzone-update.sh +4 -4
- package/manage/scripts/workspace/ports-apps.sh +1 -1
- package/manage/scripts/workspace/ports-workspace.sh +15 -15
- package/manage/scripts/workspace/workspace-clone.sh +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# shellcheck shell=bash
|
|
3
3
|
# Renames the files and folders that devzone wrote under their former French
|
|
4
|
-
# names to their English names (#733, lot 3), and the state
|
|
5
|
-
# platform= (lot 4)
|
|
4
|
+
# names to their English names (#733, lot 3), and the state keys plateforme= to
|
|
5
|
+
# platform= (lot 4) and ia= to ai= (#774, lot 3). #774, lot 4 adds the folders of the
|
|
6
|
+
# port watcher, the state backup, the AI measures file and the packages marker.
|
|
7
|
+
# Called by the pod startup, by the workspace init, and on the
|
|
6
8
|
# workstation by devzone update and workspace update.
|
|
7
9
|
# Idempotent: a name is renamed only when the old one exists and the new one
|
|
8
10
|
# does not, so a second run does nothing. Two folders with both names are
|
|
@@ -91,6 +93,50 @@ migrate_root() {
|
|
|
91
93
|
rename_legacy "$ROOT/.devzone.etat" "$ROOT/.devzone.state"
|
|
92
94
|
rename_legacy "$ROOT/.devzone.catalogue-veilleur" "$ROOT/.devzone.catalog-watcher"
|
|
93
95
|
migrate_markers
|
|
96
|
+
# Failure marker of the AI module, renamed with it (#774)
|
|
97
|
+
rename_legacy "$ROOT/.devzone.modules-failed-ia" "$ROOT/.devzone.modules-failed-ai"
|
|
98
|
+
# Backup of the previous state (#774, lot 4)
|
|
99
|
+
rename_legacy "$ROOT/.devzone.modules.prec" "$ROOT/.devzone.modules.prev"
|
|
100
|
+
migrate_ports
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# is_watcher PID: true when PID is a live port watcher (its command line names
|
|
104
|
+
# ports-workspace.sh), so a pid file left by a dead watcher never makes us
|
|
105
|
+
# signal an unrelated process that reuses the number
|
|
106
|
+
is_watcher() {
|
|
107
|
+
[ -n "${1:-}" ] || return 1
|
|
108
|
+
kill -0 "$1" 2>/dev/null || return 1
|
|
109
|
+
ps -p "$1" -o command= 2>/dev/null | grep -q 'ports-workspace\.sh'
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
# Folders of the workstation port watcher (#774, lot 4): relais/ becomes
|
|
113
|
+
# relays/, pris/ taken/ and verrou lock. A watcher that is running keeps the
|
|
114
|
+
# old folders and creates them again at each round, so it is stopped first:
|
|
115
|
+
# SIGTERM, and its own handler removes its relays, its lock and its pid. It is
|
|
116
|
+
# not restarted here (the files of the package are replaced after this
|
|
117
|
+
# script): devzone workspace start, or devzone workspace ports start, starts
|
|
118
|
+
# the new one. If it does not stop within 2 s, nothing is renamed.
|
|
119
|
+
migrate_ports() {
|
|
120
|
+
local d="$ROOT/.devzone.workspace-ports" pid
|
|
121
|
+
is_real_dir "$d" || return 0
|
|
122
|
+
[ -e "$d/relais" ] || [ -L "$d/relais" ] || [ -e "$d/pris" ] || [ -L "$d/pris" ] ||
|
|
123
|
+
[ -e "$d/verrou" ] || [ -L "$d/verrou" ] || return 0
|
|
124
|
+
pid="$(cat "$d/pid" 2>/dev/null || true)"
|
|
125
|
+
if is_watcher "$pid"; then
|
|
126
|
+
kill "$pid" 2>/dev/null || true
|
|
127
|
+
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
|
128
|
+
is_watcher "$pid" || break
|
|
129
|
+
sleep 0.2
|
|
130
|
+
done
|
|
131
|
+
if is_watcher "$pid"; then
|
|
132
|
+
echo "devzone : port watcher (pid $pid) still running, $d folders kept under their old names" >&2
|
|
133
|
+
return 0
|
|
134
|
+
fi
|
|
135
|
+
echo "devzone : port watcher stopped to rename its folders, restart it: devzone workspace ports start"
|
|
136
|
+
fi
|
|
137
|
+
rename_legacy "$d/relais" "$d/relays"
|
|
138
|
+
rename_legacy "$d/pris" "$d/taken"
|
|
139
|
+
rename_legacy "$d/verrou" "$d/lock"
|
|
94
140
|
}
|
|
95
141
|
|
|
96
142
|
# Fingerprint of the devzone skill, next to its SKILL.md in each assistant folder
|
|
@@ -100,39 +146,50 @@ migrate_skills() {
|
|
|
100
146
|
for d in "$HOME/.claude/skills/devzone" "$HOME/.config/opencode/skills/devzone"; do
|
|
101
147
|
rename_legacy "$d/.devzone-empreinte" "$d/.devzone-fingerprint"
|
|
102
148
|
done
|
|
149
|
+
# Measures of the host models (#774, lot 4); DEVZONE_AI_MEASURES points to
|
|
150
|
+
# a file of the user, never renamed
|
|
151
|
+
rename_legacy "$HOME/.config/devzone/ia-mesures.json" "$HOME/.config/devzone/ai-measures.json"
|
|
103
152
|
}
|
|
104
153
|
|
|
105
154
|
# Markers written in the temporary folder by the packages check
|
|
106
155
|
migrate_tmp() {
|
|
107
156
|
rename_legacy "$TMP_DIR/devzone-paquets.echec" "$TMP_DIR/devzone-packages.failed"
|
|
157
|
+
rename_legacy "$TMP_DIR/devzone-paquets.maj" "$TMP_DIR/devzone-packages.updated"
|
|
108
158
|
}
|
|
109
159
|
|
|
110
|
-
# Key of the state file
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
-
#
|
|
114
|
-
|
|
160
|
+
# Key of the state file: the line <old>=<v> becomes <new>=<v>. When a <new>=
|
|
161
|
+
# line is already there, only the old line goes. The file is rewritten in a
|
|
162
|
+
# temporary file, then moved over it; the other lines are copied as they are.
|
|
163
|
+
# A file without the old key is left alone.
|
|
164
|
+
migrate_state_key() {
|
|
165
|
+
local old="$1" new="$2"
|
|
115
166
|
local f="$ROOT/.devzone.modules" tmp="$ROOT/.devzone.modules.tmp.$$"
|
|
116
167
|
[ -f "$f" ] || return 0
|
|
117
|
-
grep -q
|
|
118
|
-
if grep -q
|
|
119
|
-
sed
|
|
168
|
+
grep -q "^$old=" "$f" || return 0
|
|
169
|
+
if grep -q "^$new=" "$f"; then
|
|
170
|
+
sed "/^$old=/d" "$f" >"$tmp"
|
|
120
171
|
else
|
|
121
|
-
sed
|
|
172
|
+
sed "s/^$old=/$new=/" "$f" >"$tmp"
|
|
122
173
|
fi || {
|
|
123
174
|
rm -f "$tmp"
|
|
124
|
-
echo "devzone :
|
|
175
|
+
echo "devzone : $old= not renamed to $new=" >&2
|
|
125
176
|
return 0
|
|
126
177
|
}
|
|
127
178
|
if mv -- "$tmp" "$f"; then
|
|
128
|
-
echo "devzone :
|
|
179
|
+
echo "devzone : $old= renamed to $new="
|
|
129
180
|
else
|
|
130
181
|
rm -f "$tmp"
|
|
131
|
-
echo "devzone :
|
|
182
|
+
echo "devzone : $old= not renamed to $new=" >&2
|
|
132
183
|
fi
|
|
133
184
|
return 0
|
|
134
185
|
}
|
|
135
186
|
|
|
187
|
+
# Keys of the state file: plateforme= (#733, lot 4), ia= (#774, lot 3)
|
|
188
|
+
migrate_state_keys() {
|
|
189
|
+
migrate_state_key plateforme platform
|
|
190
|
+
migrate_state_key ia ai
|
|
191
|
+
}
|
|
192
|
+
|
|
136
193
|
migrate_root
|
|
137
194
|
migrate_skills
|
|
138
195
|
migrate_tmp
|
|
@@ -3,11 +3,11 @@ name: devzone
|
|
|
3
3
|
description: Use to work in a devzone container — modules and catalog, devzone agent, worktrees, guard.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- devzone : skill set by devzone enable
|
|
6
|
+
<!-- devzone : skill set by devzone enable ai -->
|
|
7
7
|
|
|
8
8
|
# devzone skill (AI assistants)
|
|
9
9
|
|
|
10
|
-
This skill is for Claude Code (lead) and opencode (developer) in a devzone container. It is set by `devzone enable
|
|
10
|
+
This skill is for Claude Code (lead) and opencode (developer) in a devzone container. It is set by `devzone enable ai` in `~/.claude/skills/devzone/` and `~/.config/opencode/skills/devzone/` (volumes, kept across rebuilds). To customize it without it being replaced, remove the marker line above.
|
|
11
11
|
|
|
12
12
|
## Golden rule
|
|
13
13
|
|
|
@@ -23,8 +23,8 @@ Projects live in `workspace/`; ticket worktrees under `workspace/wt/`. A worktre
|
|
|
23
23
|
|
|
24
24
|
Modules are disabled by default, enabled on demand, without a rebuild:
|
|
25
25
|
|
|
26
|
-
- `devzone enable
|
|
27
|
-
- `devzone disable
|
|
26
|
+
- `devzone enable ai`: Claude Code and opencode (pinned versions), repowarden guard, default opencode configuration. Then log in: `claude` (then `/login`), `opencode auth login`.
|
|
27
|
+
- `devzone disable ai`: uninstalls the assistants; removes the guard and the default opencode configuration; keeps the state of `devzone agent`, the logs `workspace/.agents/` and the logins.
|
|
28
28
|
- `devzone enable kubernetes`: connects to the machine's cluster at each startup and installs metrics-server on local clusters.
|
|
29
29
|
- `devzone enable gitlab`: installs a test GitLab in the services cluster (namespace `devzone-gitlab*`).
|
|
30
30
|
- `devzone enable postgres`: shared PostgreSQL, one database per project (`devzone postgres create <project>`).
|
|
@@ -42,14 +42,14 @@ The choice is specific to each devzone, kept in `.devzone.modules` of the devzon
|
|
|
42
42
|
## Directing opencode (devzone agent)
|
|
43
43
|
|
|
44
44
|
`devzone agent <folder> <instruction-file>` directs opencode on an instruction, in the foreground or in parallel (`&`, one per ticket and per worktree).
|
|
45
|
-
- `devzone agent
|
|
46
|
-
- `devzone agent
|
|
45
|
+
- `devzone agent state`: sessions, discarded models and their cause.
|
|
46
|
+
- `devzone agent release <model>|--all`: lifts a model discard.
|
|
47
47
|
|
|
48
48
|
The log is `workspace/.agents/<folder>.log`. `--auto` avoids waiting for a permission; `< /dev/null` avoids a silent session.
|
|
49
49
|
|
|
50
50
|
## Guard and protected files
|
|
51
51
|
|
|
52
|
-
With `
|
|
52
|
+
With `ai` active, the repowarden guard is plugged in for Claude Code and opencode: the agent is stopped before modifying `main`/`develop`, committing without `repowarden cc` or bypassing the hooks. `repowarden cc -m "…"` to commit.
|
|
53
53
|
|
|
54
54
|
Protected rights files (never written by an agent, fixed list, no variable changes it): `.devcontainer/opencode/agent.json`, `.devcontainer/opencode.jsonc`, `.repowarden.conf`, `.devcontainer/agent-rights.sh`. An agent that touches them is refused and the change is reverted in the tree.
|
|
55
55
|
|
package/.devcontainer/state.sh
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# or removes a line of $ETAT. A mkdir lock prevents two simultaneous writes,
|
|
4
4
|
# the temporary file is created in the state folder (the mv stays atomic: the
|
|
5
5
|
# file is never missing or incomplete for a reader) and a backup copy
|
|
6
|
-
# $ETAT.
|
|
6
|
+
# $ETAT.prev precedes each replacement. The same file creates the state when
|
|
7
7
|
# it is missing: former global state taken over once, backup copy restored,
|
|
8
8
|
# state rebuilt from the services cluster, otherwise first installation.
|
|
9
9
|
# Sourced library: the caller defines ETAT (file name kept: shared by callers).
|
|
@@ -29,7 +29,7 @@ state_abort() {
|
|
|
29
29
|
# Backup copy of the current state, before replacement
|
|
30
30
|
state_backup() {
|
|
31
31
|
[ -f "$ETAT" ] || return 0
|
|
32
|
-
cp "$ETAT" "${ETAT}.
|
|
32
|
+
cp "$ETAT" "${ETAT}.prev"
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
# The state without the line $1, written to the temporary file $2
|
|
@@ -41,7 +41,7 @@ state_filter() {
|
|
|
41
41
|
return 0
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
# Under lock: replaces the whole state with a file, $ETAT.
|
|
44
|
+
# Under lock: replaces the whole state with a file, $ETAT.prev backed up
|
|
45
45
|
state_replace() {
|
|
46
46
|
local src="$1" tmp
|
|
47
47
|
[ -f "$src" ] || return 1
|
|
@@ -111,7 +111,7 @@ state_recovery_confirm() {
|
|
|
111
111
|
state_default() {
|
|
112
112
|
local stage code=0
|
|
113
113
|
stage="$(mktemp)" || return 1
|
|
114
|
-
printf '
|
|
114
|
+
printf 'ai=off\nkubernetes=off\ngitlab=off\n' >"$stage"
|
|
115
115
|
state_replace "$stage" || code=$?
|
|
116
116
|
rm -f "$stage"
|
|
117
117
|
return "$code"
|
|
@@ -191,7 +191,7 @@ state_init() {
|
|
|
191
191
|
return 0
|
|
192
192
|
fi
|
|
193
193
|
# 1. Backup copy left by the last write (#417)
|
|
194
|
-
if [ -f "${ETAT}.
|
|
194
|
+
if [ -f "${ETAT}.prev" ] && state_replace "${ETAT}.prev"; then
|
|
195
195
|
echo "devzone : state restored from the backup copy: $ETAT (confirm with devzone apply)" >&2
|
|
196
196
|
state_recovery_mark
|
|
197
197
|
state_lock_release
|
|
@@ -213,7 +213,7 @@ state_init() {
|
|
|
213
213
|
# once, when the state of this instance is created; stderr: init is also
|
|
214
214
|
# called inside $(value …)
|
|
215
215
|
if [ -f "$HOME/.claude/.credentials.json" ] || [ -f "$HOME/.local/share/opencode/auth.json" ]; then
|
|
216
|
-
echo "devzone : shared Claude Code/opencode connection found: devzone enable
|
|
216
|
+
echo "devzone : shared Claude Code/opencode connection found: devzone enable ai to use it here" >&2
|
|
217
217
|
fi
|
|
218
218
|
return 0
|
|
219
219
|
}
|
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ devzone: state (devzone to show it again)
|
|
|
108
108
|
ou git config --file ~/.config/git/config user.name "<nom>" et user.email "<email>"
|
|
109
109
|
✔ plateforme github
|
|
110
110
|
✔ GitHub connecté
|
|
111
|
-
○ module
|
|
111
|
+
○ module ai optional, assistants IA : Claude Code, opencode: devzone enable ai
|
|
112
112
|
○ module kubernetes optional, connexion au cluster de l'hôte et metrics-server au démarrage: devzone enable kubernetes
|
|
113
113
|
○ module gitlab optional, GitLab de test dans le cluster des services: devzone enable gitlab
|
|
114
114
|
```
|
|
@@ -167,7 +167,7 @@ To learn more: [Starting a project](https://github.com/SimBienvenueHoulBoumi/dev
|
|
|
167
167
|
| Languages | Java 21 + Maven + Gradle, Node LTS + pnpm, Go 1.27.4, Python 3.12 (apt) + uv |
|
|
168
168
|
| Containers, Kubernetes | Host Docker (shared socket), kubectl, helm, k9s, kind; connection to the host cluster (`kubernetes` module); Testcontainers (`TESTCONTAINERS_HOST_OVERRIDE`); mounts (`$LOCAL_WORKSPACE_FOLDER`) |
|
|
169
169
|
| GitHub (or GitLab), quality | gh, or glab connected to a GitLab instance (`devzone platform gitlab` in the container, [manage/docs/reference.md](manage/docs/reference.md#platform-github-or-gitlab)); repowarden (global git hooks), shellcheck, bats, actionlint, gitleaks, ruff, vulture, pytest |
|
|
170
|
-
| AI assistants | Claude Code, opencode (`
|
|
170
|
+
| AI assistants | Claude Code, opencode (`ai` module, disabled by default) |
|
|
171
171
|
|
|
172
172
|
## Installing a tool that stays
|
|
173
173
|
|
|
@@ -225,7 +225,7 @@ cd mon-devzone
|
|
|
225
225
|
npx devzone@latest update
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
The command shows the folder's version and the package's, and does nothing if they are equal. Otherwise, it backs up the replaced or deleted files to `.devzone.backup/<date>/`, lists the locally modified files and asks for confirmation (`--yes` for a script; without a terminal, `--yes` is required), replaces the package files, removes the old trees (`core/`, `scripts/`), completes `.gitignore` without overwriting it, then proposes `make rebuild`. `--
|
|
228
|
+
The command shows the folder's version and the package's, and does nothing if they are equal. Otherwise, it backs up the replaced or deleted files to `.devzone.backup/<date>/`, lists the locally modified files and asks for confirmation (`--yes` for a script; without a terminal, `--yes` is required), replaces the package files, removes the old trees (`core/`, `scripts/`), completes `.gitignore` without overwriting it, then proposes `make rebuild`. `--no-rebuild` skips this proposal; without a terminal, the rebuild is never launched.
|
|
229
229
|
|
|
230
230
|
`workspace/`, `.devzone.modules`, `.devzone.packages`, `.password`, `.app`, `.devzone.log` and the Docker volumes are never touched.
|
|
231
231
|
|
|
@@ -239,9 +239,9 @@ In the container, the `devzone` summary reports a more recent published version
|
|
|
239
239
|
|
|
240
240
|
**Mode at creation**: `--kubernetes` (workspace in the cluster, refused without a cluster). Without an option, the cluster must answer, otherwise nothing is created (see [A cluster at creation](#a-cluster-at-creation)).
|
|
241
241
|
|
|
242
|
-
**`
|
|
242
|
+
**`ai` module**: enables Claude Code and opencode (pinned versions), with the repowarden guard that stops them before they modify `main` or `develop` or commit without `repowarden cc` (see [manage/docs/reference.md](manage/docs/reference.md#ai-assistants-guard)). To enable it: `devzone enable ai`. They are uninstalled when the module is disabled, but your logins stay in their volumes. The module also sets up a guard that stops the `docker` commands of agents: devzone is Kubernetes first, only pods are containers (`kubectl`, or a disposable pod, instead).
|
|
243
243
|
|
|
244
|
-
**Models on your computer**: devzone hosts no model. If Ollama runs on your machine, `devzone enable
|
|
244
|
+
**Models on your computer**: devzone hosts no model. If Ollama runs on your machine, `devzone enable ai` detects its models and connects them to opencode (nothing is installed or downloaded). `devzone ai` lists them with the default model, `devzone ai check` says whether each one is up to date without downloading anything, and `devzone ai rapport` details the selected model and why (the `DEVZONE_HOST_MODEL` variable, a measurement, or the rule “a code model first, then the smallest”). Details in [manage/docs/reference.md](manage/docs/reference.md#opencode-configuration). The `llm` module (model hosted in the cluster) has been removed: devzone hosts no model.
|
|
245
245
|
|
|
246
246
|
**`kubernetes` module**: enables, at each startup, the connection to the host cluster and the installation of metrics-server on local clusters (to see CPU and RAM in k9s). To enable it: `devzone enable kubernetes`. Without this module, kubectl, helm, k9s and kind remain installed.
|
|
247
247
|
|
|
@@ -435,7 +435,7 @@ This command only removes the `devzone` command from your machine; it deletes ne
|
|
|
435
435
|
Commands, subcommands and options are written in English. The old French names are removed: devzone refuses them, shows the new name and does nothing.
|
|
436
436
|
|
|
437
437
|
```
|
|
438
|
-
✖ « activer »
|
|
438
|
+
✖ « activer » was renamed: devzone enable
|
|
439
439
|
```
|
|
440
440
|
|
|
441
441
|
The full table (commands, subcommands, options) is in [the reference](manage/docs/reference.md#removed-names).
|
package/bin/SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
756592afb5d1379ce666ae3eaa32c0976552a23bb4291b8d59708d110e3666d4 devzone-linux-amd64
|
|
2
|
+
f55f915f65873574d660a7700c110e91d7f8465e4d49da752101c459c270a9e8 devzone-linux-arm64
|
|
3
|
+
d33ee662669989fb19cc2c4539e07cd8014be61719fc182f0c7351eac42a94ee devzone-darwin-amd64
|
|
4
|
+
dbc3bf55a5c35e49d939b4dbc115b90729100b4cfcbd315c7ca8ad777ee4921b devzone-darwin-arm64
|
|
5
|
+
28dba34a40454d4d28efa494e686cf4122d99b35b9556d691e7c0ce8ac64897e devzone-windows-amd64.exe
|
|
6
|
+
0567a2b01f6ef942af62422b5da6aa1e72550ca37e62b51a02e54a382dc2ba45 devzone-windows-arm64.exe
|
package/bin/devzone-darwin-amd64
CHANGED
|
Binary file
|
package/bin/devzone-darwin-arm64
CHANGED
|
Binary file
|
package/bin/devzone-linux-amd64
CHANGED
|
Binary file
|
package/bin/devzone-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/manage/devzone
CHANGED
|
@@ -148,25 +148,31 @@ go_launch() {
|
|
|
148
148
|
|
|
149
149
|
show_help() {
|
|
150
150
|
cat <<EOT
|
|
151
|
-
devzone $(version)
|
|
151
|
+
devzone $(version): development workspace in a Kubernetes cluster
|
|
152
152
|
|
|
153
|
-
devzone <
|
|
154
|
-
|
|
153
|
+
devzone <folder> [--gitops github|none|<url>] [--kubernetes]
|
|
154
|
+
creates a devzone in <folder> (package files, .argocd.conf,
|
|
155
|
+
.devzone.modules), then starts its workspace in the cluster;
|
|
156
|
+
a folder that is not empty is refused
|
|
155
157
|
GitOps repository for Argo CD: github, or a URL, or none
|
|
156
158
|
--kubernetes: workspace in the cluster (default when it answers;
|
|
157
159
|
fails with nothing created without one)
|
|
158
|
-
devzone update [--yes]
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
devzone update [--yes]
|
|
161
|
+
in a devzone folder: replaces the package files with those of
|
|
162
|
+
the installed package, after backing up the replaced files in
|
|
163
|
+
.devzone.backup/ (the new image is used at the next workspace start)
|
|
164
|
+
devzone uninstall in a devzone folder: lists what devzone installed outside the
|
|
165
|
+
folder (leftovers of older versions, kind clusters, services,
|
|
166
|
+
metrics-server), asks for confirmation, then removes it;
|
|
167
|
+
workspace/ is kept (run before npm uninstall -g devzone)
|
|
163
168
|
devzone workspace start|stop|status|shell|update
|
|
164
169
|
devzone workspace vscode|copy-to|copy-from|clone
|
|
165
|
-
|
|
170
|
+
Kubernetes workspace: drives the devzone-workspace chart
|
|
171
|
+
(start installs it, stop removes it from the cluster)
|
|
166
172
|
devzone workspace services enable|disable <service>|status
|
|
167
|
-
services (gitlab, postgres, argocd)
|
|
173
|
+
services (gitlab, postgres, argocd) of the Kubernetes workspace
|
|
168
174
|
devzone workspace argocd status|init|apply|app add|list|remove
|
|
169
|
-
Argo CD
|
|
175
|
+
Argo CD of the workspace: GitOps repository, .argocd.conf, projects
|
|
170
176
|
(old French names: refused with the new name, see the README, « Removed names »)
|
|
171
177
|
devzone --version
|
|
172
178
|
EOT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Update of a devzone (devzone update [--yes] [--
|
|
2
|
+
# Update of a devzone (devzone update [--yes] [--no-rebuild]): replaces
|
|
3
3
|
# the files of the package, backs up the replaced or removed ones, removes the
|
|
4
4
|
# old layout, then offers the rebuild. Sourced by manage/devzone, after
|
|
5
5
|
# devzone-manifest.sh, which provides the manifest helpers.
|
|
@@ -12,9 +12,9 @@ update_workstation() {
|
|
|
12
12
|
for arg in "$@"; do
|
|
13
13
|
case "$arg" in
|
|
14
14
|
--yes) assume_yes=1 ;;
|
|
15
|
-
--
|
|
15
|
+
--no-rebuild) no_rebuild=1 ;;
|
|
16
16
|
*)
|
|
17
|
-
echo "✖ option
|
|
17
|
+
echo "✖ unknown option: $arg (devzone update [--yes] [--no-rebuild])" >&2
|
|
18
18
|
exit 1
|
|
19
19
|
;;
|
|
20
20
|
esac
|
|
@@ -202,7 +202,7 @@ update_workstation() {
|
|
|
202
202
|
return 0
|
|
203
203
|
fi
|
|
204
204
|
if [ -n "$no_rebuild" ]; then
|
|
205
|
-
echo "Reconstruction non lancée (--
|
|
205
|
+
echo "Reconstruction non lancée (--no-rebuild)."
|
|
206
206
|
return 0
|
|
207
207
|
fi
|
|
208
208
|
if [ ! -t 0 ]; then
|
|
@@ -140,7 +140,7 @@ pa_status() {
|
|
|
140
140
|
for f in "$d"/apps/*; do
|
|
141
141
|
[ -e "$f" ] || continue
|
|
142
142
|
loc="$(cat "$f")"
|
|
143
|
-
pw_alive "$(cat "$d/
|
|
143
|
+
pw_alive "$(cat "$d/relays/$loc" 2>/dev/null)" || continue
|
|
144
144
|
key="$(basename "$f")"
|
|
145
145
|
rest="${key#*.}"
|
|
146
146
|
echo " http://127.0.0.1:$loc ${key%%.*}/${rest%%.*}:${rest#*.}"
|
|
@@ -91,16 +91,16 @@ pw_taken() {
|
|
|
91
91
|
pw_relay() {
|
|
92
92
|
local port="$1" ns="$2" target="$3" remote="${4:-$1}" d pid
|
|
93
93
|
d="$(pw_dir)"
|
|
94
|
-
pid="$(cat "$d/
|
|
94
|
+
pid="$(cat "$d/relays/$port" 2>/dev/null || true)"
|
|
95
95
|
pw_alive "$pid" && return 0
|
|
96
96
|
if pw_taken "$port"; then
|
|
97
|
-
[ -e "$d/
|
|
97
|
+
[ -e "$d/taken/$port" ] || { : >"$d/taken/$port"; echo "⚠ port $port already in use on the workstation, not relayed"; }
|
|
98
98
|
return 0
|
|
99
99
|
fi
|
|
100
100
|
# shellcheck disable=SC2046
|
|
101
101
|
kubectl $(pw_ctx) --namespace "$ns" port-forward --address 127.0.0.1 "$target" "$port:$remote" </dev/null >/dev/null 2>&1 &
|
|
102
|
-
echo $! >"$d/
|
|
103
|
-
rm -f "$d/
|
|
102
|
+
echo $! >"$d/relays/$port"
|
|
103
|
+
rm -f "$d/taken/$port"
|
|
104
104
|
echo "→ port $port relayed on 127.0.0.1"
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -108,16 +108,16 @@ pw_relay() {
|
|
|
108
108
|
pw_remove() {
|
|
109
109
|
local d pid
|
|
110
110
|
d="$(pw_dir)"
|
|
111
|
-
pid="$(cat "$d/
|
|
111
|
+
pid="$(cat "$d/relays/$1" 2>/dev/null || true)"
|
|
112
112
|
if pw_alive "$pid"; then kill "$pid" 2>/dev/null || true; fi
|
|
113
|
-
rm -f "$d/
|
|
113
|
+
rm -f "$d/relays/$1" "$d/taken/$1"
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
# One watcher round: relay new ports, remove those that disappeared.
|
|
117
117
|
pw_round() {
|
|
118
118
|
local d wanted="" p ns target remote l f
|
|
119
119
|
d="$(pw_dir)"
|
|
120
|
-
mkdir -p "$d/
|
|
120
|
+
mkdir -p "$d/relays" "$d/taken"
|
|
121
121
|
while IFS='|' read -r p ns target remote; do
|
|
122
122
|
[ -n "$p" ] || continue
|
|
123
123
|
wanted="$wanted $p "
|
|
@@ -133,7 +133,7 @@ pw_round() {
|
|
|
133
133
|
wanted="$wanted $p "
|
|
134
134
|
pw_relay "$p" "$ns" "$target" "$remote"
|
|
135
135
|
done <<<"$(pa_round "$wanted")"
|
|
136
|
-
for f in "$d"/
|
|
136
|
+
for f in "$d"/relays/* "$d"/taken/*; do
|
|
137
137
|
[ -e "$f" ] || continue
|
|
138
138
|
l="$(basename "$f")"
|
|
139
139
|
case "$wanted" in *" $l "*) ;; *) pw_remove "$l" ;; esac
|
|
@@ -143,7 +143,7 @@ pw_round() {
|
|
|
143
143
|
# Removes all relays from the state folder.
|
|
144
144
|
pw_remove_all() {
|
|
145
145
|
local f
|
|
146
|
-
for f in "$(pw_dir)"/
|
|
146
|
+
for f in "$(pw_dir)"/relays/*; do
|
|
147
147
|
if [ -e "$f" ]; then pw_remove "$(basename "$f")"; fi
|
|
148
148
|
done
|
|
149
149
|
}
|
|
@@ -152,7 +152,7 @@ pw_remove_all() {
|
|
|
152
152
|
pw_loop() {
|
|
153
153
|
local d
|
|
154
154
|
d="$(pw_dir)"
|
|
155
|
-
trap 'pw_remove_all; rm -rf "$d/
|
|
155
|
+
trap 'pw_remove_all; rm -rf "$d/lock" "$d/pid"; exit 0' TERM INT
|
|
156
156
|
while :; do
|
|
157
157
|
pw_round || true
|
|
158
158
|
sleep "${DEVZONE_PORTS_WORKSPACE_STEP:-3}" &
|
|
@@ -172,8 +172,8 @@ ports_start() {
|
|
|
172
172
|
echo "Workspace ports: watcher already running (pid $pid)"
|
|
173
173
|
return 0
|
|
174
174
|
fi
|
|
175
|
-
rm -rf "$d/
|
|
176
|
-
mkdir "$d/
|
|
175
|
+
rm -rf "$d/lock"
|
|
176
|
+
mkdir "$d/lock" 2>/dev/null || return 0
|
|
177
177
|
nohup bash "${BASH_SOURCE[0]}" loop >>"$d/journal.log" 2>&1 &
|
|
178
178
|
echo $! >"$d/pid"
|
|
179
179
|
disown 2>/dev/null || true
|
|
@@ -190,7 +190,7 @@ ports_stop() {
|
|
|
190
190
|
for _ in 1 2 3 4 5 6 7 8 9 10; do pw_alive "$pid" || break; sleep 0.2; done
|
|
191
191
|
fi
|
|
192
192
|
pw_remove_all
|
|
193
|
-
rm -rf "$d/
|
|
193
|
+
rm -rf "$d/lock" "$d/pid"
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
# Shows status: watcher, relayed ports, reported taken ports.
|
|
@@ -199,10 +199,10 @@ ports_status() {
|
|
|
199
199
|
d="$(pw_dir)"
|
|
200
200
|
pid="$(cat "$d/pid" 2>/dev/null || true)"
|
|
201
201
|
if pw_alive "$pid"; then echo "Port watcher: running (pid $pid)"; else echo "Port watcher: stopped"; fi
|
|
202
|
-
for f in "$d"/
|
|
202
|
+
for f in "$d"/relays/*; do
|
|
203
203
|
if [ -e "$f" ] && pw_alive "$(cat "$f")"; then echo " 127.0.0.1:$(basename "$f") relayed"; fi
|
|
204
204
|
done
|
|
205
|
-
for f in "$d"/
|
|
205
|
+
for f in "$d"/taken/*; do
|
|
206
206
|
if [ -e "$f" ]; then echo " ⚠ port $(basename "$f") already in use on the workstation, not relayed"; fi
|
|
207
207
|
done
|
|
208
208
|
pa_status
|
|
@@ -65,13 +65,13 @@ workspace_clone() {
|
|
|
65
65
|
bash -s -- "$PROJECTS_DIR/$name" "$url" "$git_name" "$git_email"
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
# Guard of the agents in the pod (#558): when the
|
|
68
|
+
# Guard of the agents in the pod (#558): when the ai module is on there,
|
|
69
69
|
# "repowarden agents init --global" is run (idempotent), so that an agent
|
|
70
70
|
# launched in the pod cannot edit develop. Never fails the workspace start.
|
|
71
71
|
workspace_agents_guard() {
|
|
72
72
|
# shellcheck disable=SC2046
|
|
73
73
|
if kubectl $(kubectl_flag) exec "$POD" --namespace "$NAMESPACE" -c workspace -- \
|
|
74
|
-
bash -lc 'devzone is-enabled
|
|
74
|
+
bash -lc 'devzone is-enabled ai && repowarden agents init --global' >/dev/null 2>&1; then
|
|
75
75
|
echo "✔ repowarden guard active for the agents of the pod"
|
|
76
76
|
fi
|
|
77
77
|
}
|