devzone 7.5.0 → 7.5.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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck disable=SC2034 # shared variables, read by the sourced devzone-*.sh
3
- # devzone help (devzone --help): .devcontainer/help.sh, sourced below.
3
+ # devzone help (devzone --help): the Go command of the pod, below.
4
4
  #
5
5
  # Per-instance state: $RACINE/.devzone.modules (a folder mounted from the host,
6
6
  # survives rebuilds), one line "module=on|off"; the chosen platform is kept
@@ -20,7 +20,9 @@ while [ -L "$SOURCE" ]; do
20
20
  esac
21
21
  done
22
22
  ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
23
+ export DEVZONE_POD_SCRIPT="${DEVZONE_POD_SCRIPT:-$ICI/devzone}"
23
24
  # Go first (#754): a command ported to Go runs in the devzone-pod binary of the image.
25
+ # DEVZONE_HOST_BIN also names that binary when a test builds it outside the image.
24
26
  # DEVZONE_NO_GO=1 forces the shell, DEVZONE_FROM_GO=1 avoids loops.
25
27
  # DEVZONE_FROM_GO only concerns this call: not inherited, so that a "devzone …"
26
28
  # run by this script reaches the Go command again (#864).
@@ -33,18 +35,23 @@ if [ -z "${DEVZONE_NO_GO:-}" ] && [ -z "$FROM_GO" ]; then
33
35
  *) POD_GO_ARCH="" ;;
34
36
  esac
35
37
  POD_GO="$ICI/bin/devzone-pod-$(uname -s | tr '[:upper:]' '[:lower:]')-$POD_GO_ARCH"
38
+ if [ -n "${DEVZONE_HOST_BIN:-}" ] && [ -x "$DEVZONE_HOST_BIN" ]; then
39
+ POD_GO="$DEVZONE_HOST_BIN"
40
+ fi
41
+ if [ -x "$POD_GO" ]; then
42
+ # Shell helpers still in use call the Go program by this variable.
43
+ export DEVZONE_HOST_BIN="$POD_GO"
44
+ fi
36
45
  if [ -n "$POD_GO_ARCH" ] && [ -x "$POD_GO" ] && "$POD_GO" handles "${1:-}" >/dev/null 2>&1; then
37
46
  DEVZONE_POD_SCRIPT="$ICI/devzone" exec "$POD_GO" "$@"
38
47
  fi
39
48
  fi
40
- # shellcheck source=SCRIPTDIR/help.sh
41
- # shellcheck disable=SC1091
42
- . "$ICI/help.sh"
43
49
  VERSIONS="$ICI/../manage/scripts/ci/versions.sh"
44
50
  # devzone folder (/workspaces/devzone); DEVZONE_ROOT for the tests
45
51
  RACINE="${DEVZONE_ROOT:-$(dirname "$ICI")}"
46
52
  # Default state of the instance; DEVZONE_STATE takes precedence (tests, CI)
47
53
  ETAT="${DEVZONE_STATE:-$RACINE/.devzone.modules}"
54
+ export DEVZONE_STATE="$ETAT"
48
55
  MODULES=(ai kubernetes gitlab postgres argocd mysql)
49
56
  INSTANCE_SUFFIX=""
50
57
  [ "${DEVZONE_INSTANCE:-devzone}" = devzone ] || INSTANCE_SUFFIX="-${DEVZONE_INSTANCE}"
@@ -90,15 +97,9 @@ GITLAB_URL_MODULE=http://gitlab.localhost:8929
90
97
  # shellcheck source=SCRIPTDIR/devzone-services.sh
91
98
  # shellcheck disable=SC1091
92
99
  . "$ICI/devzone-services.sh"
93
- # shellcheck source=SCRIPTDIR/devzone-repair.sh
94
- # shellcheck disable=SC1091
95
- . "$ICI/devzone-repair.sh"
96
100
  # shellcheck source=SCRIPTDIR/devzone-platform.sh
97
101
  # shellcheck disable=SC1091
98
102
  . "$ICI/devzone-platform.sh"
99
- # shellcheck source=SCRIPTDIR/devzone-version.sh
100
- # shellcheck disable=SC1091
101
- . "$ICI/devzone-version.sh"
102
103
  # shellcheck source=SCRIPTDIR/devzone-status.sh
103
104
  # shellcheck disable=SC1091
104
105
  . "$ICI/devzone-status.sh"
@@ -109,11 +110,11 @@ case "${1:-}" in
109
110
  state)
110
111
  export DEVZONE_STATE="$ETAT"
111
112
  case "${2:-}" in
112
- write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|json)
113
+ write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|outdated-tools|missing-worktrees|json)
113
114
  # shellcheck disable=SC2034 # DEVZONE_STATE used by state helpers
114
115
  ETAT="$DEVZONE_STATE"
115
116
  ;;
116
- *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|json" >&2; exit 1 ;;
117
+ *) echo "devzone state: write|remove|replace|init|recovery-mark|recovery-wait|recovery-pending|recovery-confirm|catalog-sync|gitops-line|held|outdated-tools|missing-worktrees|json" >&2; exit 1 ;;
117
118
  esac
118
119
  ici_state="$ICI"
119
120
  pod_state=""
@@ -135,7 +136,7 @@ case "${1:-}" in
135
136
  # The user confirms the current state (#417, step 4): the watchers
136
137
  # may uninstall again
137
138
  DEVZONE_STATE="$ETAT" bash "$ICI/devzone" state recovery-confirm
138
- apply_repowarden
139
+ "${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" apply-repowarden
139
140
  [ "$(value_of ai)" = off ] || DEVZONE_STATE="$ETAT" "$ICI/devzone" ai apply on
140
141
  # gitlab, postgres, argocd: installed from the workstation in the
141
142
  # Kubernetes workspace pod (#528), by their installer elsewhere
@@ -153,10 +154,9 @@ case "${1:-}" in
153
154
  build)
154
155
  bash "$ICI/workspace-build.sh" "${@:2}"
155
156
  ;;
156
- repair) repair_workstation ;;
157
157
  # Go only: reached when the binary did not take the call. Never call
158
158
  # "devzone" again from here, it would loop forever, see #864
159
- cluster | clusters | metrics | use | kube | ai | agent | postgres | mysql | gitlab | test-gitlab | catalog | catalog-watcher)
159
+ -h | --help | help | repair | apply-repowarden | cluster | clusters | metrics | use | kube | ai | agent | postgres | mysql | gitlab | test-gitlab | catalog | catalog-watcher)
160
160
  echo "devzone $1: Go binary of the pod unavailable (.devcontainer/bin)" >&2
161
161
  exit 1
162
162
  ;;
@@ -176,7 +176,6 @@ case "${1:-}" in
176
176
  echo "devzone passwords: Go binary of the pod unavailable (.devcontainer/bin)" >&2
177
177
  exit 1
178
178
  ;;
179
- -h | --help | help) devzone_aide ;;
180
179
  test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
181
180
  platform)
182
181
  if [ -n "${2:-}" ]; then
@@ -9,7 +9,7 @@
9
9
  show_state() {
10
10
  local name email status m late path ports_state ctx_work ctx_host packages_mark packages_names argocd_repo
11
11
  echo "devzone: state (devzone to show it again)"
12
- version_available_line
12
+ "${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" version-available-line
13
13
  name="$(git config --get user.name || true)"
14
14
  email="$(git config --get user.email || true)"
15
15
  if [ -n "$name" ] && [ -n "$email" ]; then
@@ -41,7 +41,7 @@ show_state() {
41
41
  echo " ✔ GitHub connected"
42
42
  fi
43
43
  fi
44
- if late="$(outdated_tools)"; then
44
+ if late="$("${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" state outdated-tools 2>/dev/null)"; then
45
45
  if [ -z "$late" ]; then
46
46
  echo " ✔ tools pinned versions"
47
47
  else
@@ -54,7 +54,7 @@ show_state() {
54
54
  while IFS= read -r path; do
55
55
  [ -n "$path" ] || continue
56
56
  echo " ⚠ worktree $path absent here (created outside the container?): manage it on that side, never git worktree prune here (manage/docs/reference.md, Git worktrees)"
57
- done < <(missing_worktrees)
57
+ done < <("${DEVZONE_HOST_BIN:?devzone: Go pod binary unavailable}" state missing-worktrees)
58
58
  for m in "${MODULES[@]}"; do
59
59
  if in_pod && service_module "$m"; then
60
60
  # Kubernetes workspace pod (#528): presence by the cluster DNS
@@ -3,7 +3,7 @@
3
3
  # the Kubernetes workspace pod, with a temporary administrator token (#528).
4
4
  # services-admin.sh enable|disable <service> [options of devzone enable]
5
5
  # services-admin.sh seed gitlab data of gitlab seeded again, in the pod (#538)
6
- # Run by the workstation (manage/scripts/workspace/services-workspace.sh) through
6
+ # Run by the workstation (devzone workspace services, Go) through
7
7
  # kubectl exec -i: the token comes on stdin, is never printed and lives only
8
8
  # in a temporary kubeconfig removed at the end.
9
9
  # Why: the pod has no kubeconfig and its service account is limited (#430),
package/bin/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
- a6d69bbf0722bb5d9f68cadf1e4840c0e10049930c32116bc2b85884928b1653 devzone-linux-amd64
2
- df0b379983c3ec6aa816beddd2ea92e5c08cc8f7fc4f963f5e96f4e691e455b7 devzone-linux-arm64
3
- f71e26ac6ca27d75c3577fb373729edf6544cbdb12e9228c621d6480a2502c95 devzone-darwin-amd64
4
- e047de3b934eb6fa76f683b49e2ce061923eae7d9a9b9cecbb73eda61a8078d8 devzone-darwin-arm64
5
- 6441bdd505cacb674ec91aa5c971eede8a9e13addc90f6a4d99664b5eae20903 devzone-windows-amd64.exe
6
- 4574d4d451ee11f97297273bb035f3eb8339bf046f53d95393ab4747556847d4 devzone-windows-arm64.exe
1
+ a44ed44208d3045436bbae033079c1b45e41a4a9949d59d06a01462a2753ac69 devzone-linux-amd64
2
+ 25aaf6eae0830c0baa48152eec6a76b33747154fd242f7ab170672ea528a9dd0 devzone-linux-arm64
3
+ 58c272b0adaf0d1ccc943e79758f30647b150e8fc999aac62397c2fab835c8ae devzone-darwin-amd64
4
+ bbc4f4d84cebac8883756a1aaacb4145c35aea438bedc99381a86ecf0da62908 devzone-darwin-arm64
5
+ 72b505ea10261768ca224560b194b5a03a2595d06c5e85fd6a1b21f5247a2292 devzone-windows-amd64.exe
6
+ 7b11b7e77fac4fd403c69ff2178f8e0a508d33ce8973a9ee2c887958be6e237a devzone-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/manage/devzone CHANGED
@@ -186,7 +186,7 @@ EOT
186
186
  # of .devcontainer/devzone (consistency test in manage/test/cli.bats)
187
187
  container_command() {
188
188
  case "$1" in
189
- ai | agent | apply | argocd | build | catalog | catalog-watcher | cluster | clusters | disable | \
189
+ ai | agent | apply | apply-repowarden | argocd | build | catalog | catalog-watcher | cluster | clusters | disable | \
190
190
  enable | gitlab | is-enabled | kube | llm | metrics | modules | mysql | packages | \
191
191
  passwords | platform | port | postgres | repair | start | state | status | \
192
192
  test-bash32 | test-gitlab | ticket | use) return 0 ;;
@@ -200,11 +200,9 @@ case "${1:-}" in
200
200
  "" | -h | --help | help) show_help ;;
201
201
  -v | --version) version ;;
202
202
  update)
203
- # shellcheck source=SCRIPTDIR/scripts/devzone-manifest.sh
204
- . "$PAQUET/manage/scripts/devzone-manifest.sh"
205
- # shellcheck source=SCRIPTDIR/scripts/devzone-update.sh
206
- . "$PAQUET/manage/scripts/devzone-update.sh"
207
- update_workstation "${@:2}"
203
+ # The update is the Go program's (#884); the package folder is passed through
204
+ # DEVZONE_BASH_ENTRY, as the launcher exports it when it runs the binary
205
+ DEVZONE_BASH_ENTRY="$PAQUET/manage/devzone" "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" update "${@:2}"
208
206
  ;;
209
207
  uninstall)
210
208
  # Devzone folder (.devcontainer/); an older devzone has its uninstall.sh
@@ -110,7 +110,7 @@ workspace_deploy() {
110
110
  [ -z "$with_image" ] || params="$params image.repository=$repository"
111
111
  [ "$tag" != latest ] || params="$params image.pullPolicy=Always"
112
112
  # egress proxy settings of .devzone.modules (#633): replayed at each start and update
113
- params="$params $(egress_params)"
113
+ params="$params $("${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress params)"
114
114
  chart_require workspace || return $?
115
115
  # GitOps repository created or designated first, with its root Application
116
116
  gitops_init || return 1
@@ -88,9 +88,9 @@ start_workspace() {
88
88
  if [ -n "${DEVZONE_FROM_GO:-}" ] && argocd_active; then devzone workspace deploy "$repo" "$tag" "$with_image"; else workspace_deploy "$repo" "$tag" "$with_image"; fi
89
89
  # Projects of .argocd.conf held too (#516)
90
90
  argocd_reconcile || true
91
- wait_for_pod "$image" || return 1
92
- workspace_agents_guard || true
93
- ports_start silence
91
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace wait "$image" || return 1
92
+ "${DEVZONE_HOST_BIN:-false}" workspace agents-guard || true
93
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports start
94
94
  }
95
95
 
96
96
  # helm direct: the chart of the package, image set by the options
@@ -103,14 +103,14 @@ workspace_helm_deploy() {
103
103
  # the old one with IfNotPresent (#515)
104
104
  [ "$tag" != latest ] || args+=(--set "image.pullPolicy=Always")
105
105
  # egress proxy settings (#633), replayed at each start: commas escaped for helm
106
- for p in $(egress_params | sed 's/,/\\,/g'); do args+=(--set "$p"); done
106
+ for p in $("${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress params | sed 's/,/\\,/g'); do args+=(--set "$p"); done
107
107
  # shellcheck disable=SC2046
108
108
  helm $(helm_flag) upgrade --install devzone-workspace "$(chart_path)" "${args[@]}"
109
109
  }
110
110
 
111
111
  # Uninstalls the workspace from the cluster (Argo CD Application or helm release).
112
112
  stop_workspace() {
113
- ports_stop
113
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports stop || true
114
114
  workspace_undeploy
115
115
  }
116
116
 
@@ -122,35 +122,21 @@ shell_workspace() {
122
122
 
123
123
  # shellcheck source=manage/scripts/kube-ready.sh
124
124
  . "$HERE/scripts/kube-ready.sh"
125
- # shellcheck source=manage/scripts/workspace/workspace-wait.sh
126
- . "$HERE/scripts/workspace/workspace-wait.sh"
127
- # shellcheck source=manage/scripts/workspace/workspace-clone.sh
128
- . "$HERE/scripts/workspace/workspace-clone.sh"
129
- # shellcheck source=manage/scripts/workspace/workspace-copies.sh
130
- . "$HERE/scripts/workspace/workspace-copies.sh"
131
- # shellcheck source=manage/scripts/workspace/ports-workspace.sh
132
- . "$HERE/scripts/workspace/ports-workspace.sh"
133
- # shellcheck source=manage/scripts/workspace/services-workspace.sh
134
- . "$HERE/scripts/workspace/services-workspace.sh"
135
125
  # shellcheck source=manage/scripts/workspace/argocd-workspace.sh
136
126
  . "$HERE/scripts/workspace/argocd-workspace.sh"
137
127
  # shellcheck source=manage/scripts/workspace/argocd-services.sh
138
128
  . "$HERE/scripts/workspace/argocd-services.sh"
139
- # shellcheck source=manage/scripts/workspace/workspace-update.sh
140
- . "$HERE/scripts/workspace/workspace-update.sh"
141
- # shellcheck source=manage/scripts/workspace/workspace-egress.sh
142
- . "$HERE/scripts/workspace/workspace-egress.sh"
143
129
 
144
130
  case "${1:-}" in
145
131
  start) start_workspace "${@:2}" ;;
146
- update) update_workspace "${@:2}" ;;
132
+ update) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace update "${@:2}" ;;
147
133
  stop) stop_workspace ;;
148
- status) status_workspace ;;
134
+ status) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace status ;;
149
135
  shell) shell_workspace ;;
150
- ports) ports "${@:2}" ;;
151
- services) services "${@:2}" ;;
136
+ ports) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports "${@:2}" ;;
137
+ services) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace services "${@:2}" ;;
152
138
  argocd) argocd_cmd "${@:2}" ;;
153
- egress) egress_workspace "${@:2}" ;;
139
+ egress) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress "${@:2}" ;;
154
140
  '' | -h | --help | help)
155
141
  echo "devzone workspace start|stop|status|shell|ports|services|argocd|update|egress"
156
142
  echo " start [--image repository:tag] install workspace (image for devzone version by default)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devzone",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "description": "Ton poste de développement Linux, prêt en une commande, identique sur Mac, Windows et Linux.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env bash
2
- # shellcheck shell=bash
3
- # devzone, repair of the workstation.
4
- # Sourced by .devcontainer/devzone (split of the 1 600 lines file, #722):
5
- # functions only, shared variables are defined in devzone.
6
-
7
- # Lines "package pinned installed" of the outdated tools; fails if the versions.sh
8
- # script is missing or cannot answer (the state then omits the line)
9
- outdated_tools() {
10
- [ -f "$VERSIONS" ] || return 1
11
- bash "$VERSIONS" --installees 2>/dev/null
12
- }
13
-
14
- # Sets repowarden back to the pinned version if it differs (it installs the
15
- # global git hooks)
16
- apply_repowarden() {
17
- local line pinned installed package=repowarden
18
- [ -f "$VERSIONS" ] || return 0
19
- line="$(bash "$VERSIONS" --installees 2>/dev/null | awk '$1 == "repowarden"' || true)"
20
- [ -n "$line" ] || return 0
21
- read -r _ pinned installed <<<"$line"
22
- echo "devzone : installing repowarden ${pinned}…"
23
- npm install -g "$package@$pinned" >/dev/null
24
- repowarden install --global --lang fr
25
- echo "devzone : repowarden $installed → $pinned"
26
- }
27
-
28
- # Paths of the worktrees of the devzone repository and of the workspace
29
- # repositories absent here: created on the other side (host), a git worktree
30
- # prune would break them. Read-only: nothing is deleted or repaired.
31
- missing_worktrees() {
32
- local repo line path
33
- {
34
- [ -e "$RACINE/.git" ] && echo "$RACINE"
35
- find "$RACINE/workspace" -mindepth 2 -maxdepth 3 -name .git -type d 2>/dev/null | sed 's|/\.git$||'
36
- } | while IFS= read -r repo; do
37
- { git -C "$repo" worktree list --porcelain 2>/dev/null || true; } | while IFS= read -r line; do
38
- case "$line" in
39
- "worktree "*)
40
- path="${line#worktree }"
41
- [ -d "$path" ] || echo "$path"
42
- ;;
43
- esac
44
- done
45
- done || true
46
- }
47
-
48
- # Repair (#341): repairs the workstation: relays, watchers, credentials.
49
- # Each item is really repaired; ✔ or ✖ with the reason.
50
- repair_item() {
51
- local name="$1" output code reason
52
- shift
53
- if output="$("$@" 2>&1)"; then
54
- echo "✔ $name"
55
- else
56
- code=$?
57
- reason="$(printf '%s\n' "$output" | sed '/^[[:space:]]*$/d' | tail -1)"
58
- [ -n "$reason" ] || reason="failed (code $code)"
59
- echo "✖ $name : $reason"
60
- repair_failed=1
61
- fi
62
- }
63
-
64
- # Application repairs (#341): active services, ports and credentials; a failure
65
- # does not stop the following ones.
66
- repair_workstation() {
67
- repair_failed=0
68
- if [ "$(value_of gitlab)" = on ]; then
69
- repair_item "gitlab name" "$ICI/devzone" gitlab host-set
70
- repair_item "gitlab relay" "$ICI/devzone" gitlab relay-start
71
- fi
72
- if [ "$(value_of postgres)" = on ]; then
73
- repair_item "postgres relay" "$ICI/devzone" postgres relay-start
74
- fi
75
- if [ "$(value_of argocd)" = on ]; then
76
- repair_item "argocd relay" "$ICI/devzone" argocd relay-start
77
- fi
78
- if [ "$(value_of mysql)" = on ]; then
79
- repair_item "mysql relay" "$ICI/devzone" mysql relay-start
80
- fi
81
- repair_item "catalog watcher" env DEVZONE_STATE="$ETAT" DEVZONE_CATALOG_REAL=yes "$ICI/devzone" catalog-watcher start
82
- repair_item "credentials" "$ICI/devzone" passwords regenerate
83
- "$ICI/devzone" cluster clean || true
84
- return "$repair_failed"
85
- }
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env bash
2
- # shellcheck shell=bash
3
- # devzone, version of the folder and of the published release.
4
- # Sourced by .devcontainer/devzone (split of the 1 600 lines file, #722):
5
- # functions only, shared variables are defined in devzone.
6
-
7
- # Version of the devzone folder (manifest written by the workstation CLI),
8
- # nothing if the folder predates the manifest
9
- folder_version() {
10
- local v
11
- [ -f "$RACINE/.devzone.version" ] || return 1
12
- v="$(sed -n '1s/^version //p' "$RACINE/.devzone.version" 2>/dev/null | head -1 || true)"
13
- [ -n "$v" ] || return 1
14
- printf '%s\n' "$v"
15
- }
16
-
17
- # True if the first version is newer than the second
18
- version_is_newer() {
19
- awk -v a="$1" -v b="$2" 'BEGIN {
20
- na = split(a, x, ".")
21
- nb = split(b, y, ".")
22
- n = (na > nb ? na : nb)
23
- for (i = 1; i <= n; i++) {
24
- p = (i <= na ? x[i] : 0) + 0
25
- q = (i <= nb ? y[i] : 0) + 0
26
- if (p > q) exit 0
27
- if (p < q) exit 1
28
- }
29
- exit 1
30
- }'
31
- }
32
-
33
- # Version published on npm, at most once a day, cached under
34
- # ~/.cache/devzone/; 5 s at most, silent offline
35
- published_version() {
36
- local cache day npm v tmp pid waited
37
- cache="$HOME/.cache/devzone/version-publiee"
38
- day="$(date +%Y-%m-%d)"
39
- if [ -f "$cache" ] && [ "$(sed -n '1p' "$cache" 2>/dev/null || true)" = "$day" ]; then
40
- sed -n '2p' "$cache" 2>/dev/null || true
41
- return 0
42
- fi
43
- npm="${DEVZONE_NPM:-npm}"
44
- v=""
45
- if command -v "$npm" >/dev/null 2>&1; then
46
- mkdir -p "$(dirname "$cache")" 2>/dev/null || true
47
- tmp="$cache.$$"
48
- "$npm" view devzone version >"$tmp" 2>/dev/null &
49
- pid=$!
50
- waited=0
51
- while kill -0 "$pid" 2>/dev/null; do
52
- sleep 1
53
- waited=$((waited + 1))
54
- if [ "$waited" -ge 5 ]; then
55
- kill "$pid" 2>/dev/null || true
56
- break
57
- fi
58
- done
59
- wait "$pid" 2>/dev/null || true
60
- v="$(sed -n '1p' "$tmp" 2>/dev/null | tr -d '[:space:]' || true)"
61
- rm -f "$tmp"
62
- fi
63
- mkdir -p "$(dirname "$cache")" 2>/dev/null || true
64
- printf '%s\n%s\n' "$day" "$v" >"$cache" 2>/dev/null || true
65
- [ -n "$v" ] && printf '%s\n' "$v"
66
- return 0
67
- }
68
-
69
- version_available_line() {
70
- local folder published
71
- folder="$(folder_version)" || return 0
72
- published="$(published_version)" || return 0
73
- published="${published#v}"
74
- [ -n "$published" ] || return 0
75
- if version_is_newer "$published" "$folder"; then
76
- printf ' ○ devzone %s available: on the workstation, devzone update\n' "$published"
77
- fi
78
- }
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Help of devzone (devzone --help, #557), sourced by devzone : English command
3
- # names only ; the French names are refused and print the new name (#695).
4
- # devzone_aide prints the list, indented like the other usage texts.
5
- devzone_aide() {
6
- cat <<'AIDE'
7
- Optional modules of devzone, enabled on demand, without rebuild:
8
- devzone state of the modules
9
- devzone --version version of the workspace image (DEVZONE_VERSION)
10
- devzone platform GitHub (default) or GitLab
11
- devzone platform github back to GitHub: glab and config removed
12
- devzone platform gitlab GitLab, [--url URL] (default: gitlab module)
13
- devzone enable <module> enable and apply at once
14
- devzone disable <module> [--yes] disable and apply at once (--yes: also deletes the data)
15
- devzone apply install what is enabled
16
- devzone repair repair gitlab, postgres, ports, passwords
17
- devzone catalog [list|apply|sync|resume|json|remove <app>] applications of the catalog
18
- devzone metrics [context…] | remove [context…] install or remove metrics-server (kubectl top, k9s)
19
- devzone use CTX [--confirm CTX] switch the kubectl working cluster
20
- devzone clusters view of the connected clusters (work and services)
21
- devzone kube saved|choose|save|local|reachable|prompt cluster helpers, in Go
22
- devzone is-enabled <module> code 0 if enabled
23
- devzone test-bash32 run the bats tests under bash 3.2 (Docker container)
24
- devzone test-gitlab end-to-end test of the GitLab module and platform
25
- devzone agent <folder> <instructions> drive opencode with the instructions file
26
- devzone ai list the host (Ollama) models detected and the default model
27
- devzone ai check|rapport update state of each model | sizes, choices and reasons
28
- devzone ai guard [--format claude] check one tool call on standard input (agent guard)
29
- devzone ticket <n> [--repo devzone|repowarden] ticket worktree (ticket done <n> removes it)
30
- devzone build <folder> [--tag <name>] build an image in the Kubernetes workspace (BuildKit)
31
- devzone enable postgres [--context CTX] [--confirm CTX] shared PostgreSQL, cluster of choice
32
- devzone postgres create <project> database and user of a project (also: list, psql, delete)
33
- devzone mysql create <project> database and user of a MySQL project (also: list, delete)
34
- devzone enable llm [--preset light] local code model (llama.cpp), devzone llm status
35
- devzone llm status | delete-data [--yes] model and reachability | namespace and model removed
36
- devzone gitlab migrate [--yes] GitLab in the services cluster, then the old kind cluster deleted
37
- devzone gitlab new-password [root|dev] random password (root or dev) regenerated
38
- devzone enable argocd Argo CD in the services cluster, access https://127.0.0.1:8443
39
- devzone argocd status|relay-start|relay-stop Argo CD (argocd module)
40
- devzone argocd app add <repo url> [path]|list|remove <N> projects deployed by Argo CD (#516)
41
- devzone cluster [CTX] [--yes] [--confirm CTX] services cluster of devzone, or change it
42
- devzone port [--close <n>] list or remove a relay of the workstation
43
- devzone passwords regenerate .password and print its path
44
- devzone packages [add|remove|apply] … system packages kept after a rebuild
45
- AIDE
46
- }