devzone 7.1.0 → 7.2.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 +15 -22
- package/.devcontainer/ai/host-check.message +12 -12
- package/.devcontainer/ai/host-check.sh +1 -1
- package/.devcontainer/catalog/app.sh +5 -12
- package/.devcontainer/catalog/catalog-watcher.sh +7 -7
- package/.devcontainer/catalog.sh +1 -1
- package/.devcontainer/cluster.sh +1 -11
- package/.devcontainer/devcontainer.json +1 -11
- package/.devcontainer/devzone +19 -23
- package/.devcontainer/devzone-ai.sh +1 -1
- package/.devcontainer/devzone-cluster.sh +2 -3
- package/.devcontainer/devzone-modules.sh +7 -2
- package/.devcontainer/devzone-repair.sh +11 -21
- package/.devcontainer/devzone-services.sh +21 -20
- package/.devcontainer/devzone-status.sh +4 -12
- package/.devcontainer/gitlab/demo/.gitlab-ci.yml +1 -1
- package/.devcontainer/help.sh +3 -5
- package/.devcontainer/isolation.sh +1 -1
- package/.devcontainer/kube-account.sh +12 -173
- package/.devcontainer/metrics-server.sh +1 -1
- package/.devcontainer/packages.sh +3 -3
- package/.devcontainer/password.sh +5 -6
- package/.devcontainer/ports-json.sh +0 -4
- package/.devcontainer/ports.sh +7 -103
- package/.devcontainer/services-admin.sh +2 -2
- package/.devcontainer/state-json.sh +4 -14
- package/.devcontainer/versions.env +2 -2
- package/.devcontainer/workspace-init.sh +1 -9
- package/Makefile +6 -6
- package/README.md +14 -33
- 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 +7 -20
- package/manage/scripts/ci/check-names.sh +5 -6
- package/manage/scripts/ci/ticket-protocol.txt +7 -0
- package/manage/scripts/ci/versions-tools-plan.sh +1 -1
- package/manage/scripts/devzone-create.sh +4 -4
- package/manage/scripts/devzone-update.sh +18 -22
- package/manage/scripts/workspace/argocd-services.sh +1 -1
- package/manage/scripts/workspace/argocd-workspace.sh +2 -2
- package/manage/scripts/workspace/ports-workspace.sh +5 -5
- package/manage/scripts/workspace/services-workspace.sh +3 -3
- package/manage/scripts/workspace/workspace-update.sh +0 -3
- package/manage/workspace.sh +0 -14
- package/package.json +1 -1
- package/.devcontainer/argocd/argocd.sh +0 -222
- package/.devcontainer/argocd/catalog-argocd.sh +0 -119
- package/.devcontainer/argocd/services-hook.sh +0 -181
- package/.devcontainer/catalog/mysql/install.sh +0 -87
- package/.devcontainer/catalog/mysql/mysql.sh +0 -262
- package/.devcontainer/catalog/mysql/volume.sh +0 -71
- package/.devcontainer/command-aliases.sh +0 -234
- package/.devcontainer/git-identity.sh +0 -28
- package/.devcontainer/gitlab/argocd.sh +0 -54
- package/.devcontainer/gitlab/chart.sh +0 -39
- package/.devcontainer/gitlab/gitlab.sh +0 -168
- package/.devcontainer/gitlab/installation.sh +0 -193
- package/.devcontainer/gitlab/secrets.sh +0 -95
- package/.devcontainer/gitlab/seed.sh +0 -204
- package/.devcontainer/gitlab/test-gitlab-restes.sh +0 -16
- package/.devcontainer/gitlab/test-gitlab.sh +0 -489
- package/.devcontainer/kind-wrapper.sh +0 -45
- package/.devcontainer/kube-config.sh +0 -78
- package/.devcontainer/kube-reachable.sh +0 -64
- package/.devcontainer/ports-auto.sh +0 -247
- package/.devcontainer/post-create.sh +0 -91
- package/.devcontainer/postgres/postgres.sh +0 -309
- package/.devcontainer/rename-legacy-files.sh +0 -172
- package/.devcontainer/rename-legacy-ports.sh +0 -119
- package/.devcontainer/startup.sh +0 -65
- package/manage/scripts/ci/check-english.sh +0 -57
package/Makefile
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
# to the first, without fixing anything. In the container: /.dockerenv, or folder /workspaces/devzone
|
|
9
9
|
hors-conteneur:
|
|
10
10
|
@if [ -f /.dockerenv ] || [ "$(CURDIR)" = /workspaces/devzone ]; then \
|
|
11
|
-
echo "✖ make $(MAKECMDGOALS)
|
|
12
|
-
echo "
|
|
11
|
+
echo "✖ make $(MAKECMDGOALS): run it on your machine (Mac or PC terminal), not in the devzone pod." >&2; \
|
|
12
|
+
echo " Here in the pod: devzone (state, modules), and the tools directly." >&2; \
|
|
13
13
|
exit 1; fi
|
|
14
14
|
|
|
15
15
|
help: ## Lists the commands
|
|
@@ -24,8 +24,8 @@ test-fonctionnel: hors-conteneur ## Functional tests: isolated devzone, built th
|
|
|
24
24
|
test-cli: hors-conteneur ## CLI tests in a real terminal: isolated devzone, then removed (10 to 15 min)
|
|
25
25
|
@bash manage/test/cli-terminal.sh
|
|
26
26
|
|
|
27
|
-
desinstaller: hors-conteneur ## Removes
|
|
28
|
-
@
|
|
27
|
+
desinstaller: hors-conteneur ## Removes Kubernetes objects of this devzone instance, after confirmation
|
|
28
|
+
@bash manage/devzone uninstall
|
|
29
29
|
|
|
30
|
-
uninstall: hors-conteneur ## Removes
|
|
31
|
-
@
|
|
30
|
+
uninstall: hors-conteneur ## Removes Kubernetes objects of this devzone instance, after confirmation (alias of the remove target)
|
|
31
|
+
@bash manage/devzone uninstall
|
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ git clone https://github.com/ton-compte/ton-projet.git
|
|
|
159
159
|
mkdir mon-projet && cd mon-projet && git init -b main
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
To learn more: [Starting a project](https://github.com/SimBienvenueHoulBoumi/devzone/blob/main/manage/docs/reference.md#starting-a-project).
|
|
162
|
+
To learn more: [Starting a project](https://github.com/SimBienvenueHoulBoumi/devzone/blob/main/manage/docs/reference.md#starting-a-project). Develop devzone in the pod with `devzone workspace start|shell|vscode`.
|
|
163
163
|
|
|
164
164
|
## What devzone contains
|
|
165
165
|
|
|
@@ -172,7 +172,7 @@ To learn more: [Starting a project](https://github.com/SimBienvenueHoulBoumi/dev
|
|
|
172
172
|
|
|
173
173
|
## Installing a tool that stays
|
|
174
174
|
|
|
175
|
-
A tool installed by hand
|
|
175
|
+
A tool installed by hand in the workspace pod does not survive a pod recreation: the image is rebuilt from scratch. For a tool that must stay, `devzone packages` keeps the list of packages to reinstall:
|
|
176
176
|
|
|
177
177
|
```sh
|
|
178
178
|
devzone packages
|
|
@@ -196,7 +196,7 @@ The list lives in `.devzone.packages` at the root of the devzone folder, outside
|
|
|
196
196
|
| Open a shell | VS Code terminal | `devzone workspace shell` |
|
|
197
197
|
| Stop | *Remote: Close Remote Connection* (the container stops with the window) | `devzone workspace stop` |
|
|
198
198
|
| Status | — | `devzone workspace status` |
|
|
199
|
-
| **Uninstall** (
|
|
199
|
+
| **Uninstall** (Kubernetes objects of this devzone instance, after confirmation) | — | `devzone uninstall` (in a devzone folder) |
|
|
200
200
|
|
|
201
201
|
In Kubernetes mode, the same commands apply to the pod `devzone-workspace-0`. The GitLab, PostgreSQL and Argo CD services are installed from the workstation: `devzone workspace services enable postgres` (see [the reference](manage/docs/reference.md#devzone-services-in-the-kubernetes-workspace)). You can also develop there: `devzone workspace clone <url>` makes a working clone in the pod, `devzone ticket <n>` creates the worktree of a ticket there and `devzone agent` launches opencode there without a copy ([developing in the pod](manage/docs/reference.md#developing-devzone-and-repowarden-in-the-pod)). Argo CD is installed by default there and keeps the deployments: interface at https://localhost:8443 (password `admin` in `.password`), GitOps repository `<login>/devzone-argocd` created on your GitHub, projects declared in `.argocd.conf` (`devzone workspace argocd app add <repo>`); see [Argo CD in the Kubernetes workspace](manage/docs/reference.md#argo-cd-in-the-kubernetes-workspace).
|
|
202
202
|
|
|
@@ -205,7 +205,7 @@ In the container, `devzone --version` shows the version of the workspace image,
|
|
|
205
205
|
```text
|
|
206
206
|
devzone enable <module> enable and apply at once
|
|
207
207
|
devzone use CTX [--confirm CTX] switch the kubectl working cluster
|
|
208
|
-
devzone port [
|
|
208
|
+
devzone port [--close <n>] list or remove a relay of the workstation
|
|
209
209
|
```
|
|
210
210
|
|
|
211
211
|
### Updating devzone
|
|
@@ -228,11 +228,9 @@ The command shows the folder's version and the package's, and does nothing if th
|
|
|
228
228
|
|
|
229
229
|
`workspace/`, `.devzone.modules`, `.devzone.packages`, `.password`, `.app`, `.devzone.log` and the Docker volumes are never touched.
|
|
230
230
|
|
|
231
|
-
The old names of files and folders (`.devzone.paquets`, `.devzone.sauvegarde`, `.devzone.ports-workspace`, `.devzone.etat`, `.devzone.catalogue-veilleur`) are renamed once only, with their contents, by `.devcontainer/rename-legacy-files.sh`: at container startup and at update. A new name already present is never overwritten.
|
|
232
|
-
|
|
233
231
|
The Kubernetes workspace is updated separately: `devzone workspace update` moves it to the latest stable release (or `--version X.Y.Z`), image, charts and Argo CD at the same tag. **The pod `devzone-workspace-0` is recreated**: the VS Code windows attached to the pod are disconnected. The image is checked on ghcr.io before any write, and nothing changes if it does not exist yet. Details in the [reference](manage/docs/reference.md#updating-the-workspace).
|
|
234
232
|
|
|
235
|
-
In the
|
|
233
|
+
In the workspace pod, the `devzone` summary reports a more recent published version (npm check at most once a day, without blocking offline): `○ devzone X.Y.Z disponible : sur le poste, devzone update`.
|
|
236
234
|
|
|
237
235
|
## Options
|
|
238
236
|
|
|
@@ -254,7 +252,7 @@ In the container, the `devzone` summary reports a more recent published version
|
|
|
254
252
|
|
|
255
253
|
These modules are disabled by default, can be enabled on demand from the container (without a rebuild), and their choice is kept from one startup to the next.
|
|
256
254
|
|
|
257
|
-
The `devzone` command is written in English, subcommands and options included (`enable`, `disable`, `platform`, `packages`, `update`, `uninstall`, `status`, `use`; `postgres create`, `packages add`, `gitlab new-password`, `port --close`, `cluster --yes`).
|
|
255
|
+
The `devzone` command is written in English, subcommands and options included (`enable`, `disable`, `platform`, `packages`, `update`, `uninstall`, `status`, `use`; `postgres create`, `packages add`, `gitlab new-password`, `port --close`, `cluster --yes`).
|
|
258
256
|
|
|
259
257
|
## Where are my credentials?
|
|
260
258
|
|
|
@@ -361,15 +359,14 @@ A project's user owns **its** database (it creates tables, indexes, data in it)
|
|
|
361
359
|
|
|
362
360
|
On the Kubernetes workstation, `devzone workspace start` starts a port watcher: each TCP port ≥ 1024 that listens in the pod is relayed to `127.0.0.1` of the workstation, at the same number, by `kubectl port-forward`. A server started in the pod (`npm run dev`, port 5173) therefore answers at `http://localhost:5173`, without a command. The enabled services (PostgreSQL, MySQL, Argo CD) are relayed too, on their usual port. The Services of applications deployed in the cluster are relayed the same way, each on a local port (80 → 8080; a port already taken elsewhere becomes another port): `devzone workspace ports status` shows their URL `http://127.0.0.1:<port>`. A Service can be excluded with the annotation `devzone.io/relay: "false"`. The watcher is driven with `devzone workspace ports start|stop|status`; details in the [reference](manage/docs/reference.md#applications-and-services-on-the-workstations-localhost).
|
|
363
361
|
|
|
364
|
-
|
|
362
|
+
The relays kept in the state of a workstation instance are listed and closed with `devzone port`:
|
|
365
363
|
|
|
366
364
|
```sh
|
|
367
|
-
devzone port # list:
|
|
368
|
-
devzone port
|
|
369
|
-
devzone port --close <n> # removes a manual relay and its port from the state
|
|
365
|
+
devzone port # list: relay, ● active or ○ stopped, application behind it
|
|
366
|
+
devzone port --close <n> # removes the relay and its port from the state
|
|
370
367
|
```
|
|
371
368
|
|
|
372
|
-
|
|
369
|
+
In the Kubernetes workspace, the applications and services of the pod use `devzone workspace ports` instead: their relays are driven from the workstation by `kubectl port-forward`.
|
|
373
370
|
|
|
374
371
|
From the workstation: `http://localhost:8080`. The manual relay is recreated automatically at container startup, toward the container's current address; it is removed by `make uninstall` (label `devzone.instance`). The automatic relay disappears with the application.
|
|
375
372
|
|
|
@@ -409,36 +406,20 @@ The shell prompt shows `⎈ ctx/ns` (cyan if local, bold red if remote otherwise
|
|
|
409
406
|
|
|
410
407
|
## Uninstalling
|
|
411
408
|
|
|
412
|
-
|
|
413
|
-
make uninstall
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
This command removes the container, the image `vsc-devzone-…`, the `devzone-*` volumes, the events of the host's Docker and the kind clusters created on the host, the `devzone-postgres` namespaces and the `app.kubernetes.io/managed-by=devzone` labels on the host's clusters, as well as any metrics-server installed by devzone. Resources are filtered by the `devzone.instance` label to target only the current instance. It **never touches** `workspace/` (your projects). To keep your logins (GitHub, git, Claude Code, opencode and modules): `make uninstall KEEP=logins` (old `GARDER=connexions` still accepted).
|
|
417
|
-
|
|
418
|
-
With the command installed globally (`npm install -g devzone`), you can also run, in the devzone folder:
|
|
409
|
+
From a devzone folder, remove the Kubernetes objects created by this devzone instance:
|
|
419
410
|
|
|
420
411
|
```bash
|
|
421
412
|
devzone uninstall
|
|
422
413
|
```
|
|
423
414
|
|
|
424
|
-
|
|
415
|
+
The command lists the namespaces, Argo CD Applications, temporary accounts and `.devzone.*` files targeted by this instance, asks for confirmation, then removes them. `workspace/` is kept. Without a terminal, use `devzone uninstall --yes`.
|
|
416
|
+
|
|
417
|
+
To remove the `devzone` command from your machine:
|
|
425
418
|
|
|
426
419
|
```bash
|
|
427
420
|
npm uninstall -g devzone
|
|
428
421
|
```
|
|
429
422
|
|
|
430
|
-
This command only removes the `devzone` command from your machine; it deletes neither the container, nor the volumes, nor the folder.
|
|
431
|
-
|
|
432
|
-
## Removed names
|
|
433
|
-
|
|
434
|
-
Commands, subcommands and options are written in English. The old French names are removed: devzone refuses them, shows the new name and does nothing.
|
|
435
|
-
|
|
436
|
-
```
|
|
437
|
-
✖ « activer » was renamed: devzone enable
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
The full table (commands, subcommands, options) is in [the reference](manage/docs/reference.md#removed-names).
|
|
441
|
-
|
|
442
423
|
## Going further
|
|
443
424
|
|
|
444
425
|
- [Detailed reference](https://github.com/SimBienvenueHoulBoumi/devzone/blob/main/manage/docs/reference.md)
|
package/bin/SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
447c9d2c5d62fba9bbb399c62664b08d06e40357492b42840adf505b892410bc devzone-linux-amd64
|
|
2
|
+
e96b301d37f723213e0b40fca037da8172e0f9b896d10ec50d64dd4a52e3f0da devzone-linux-arm64
|
|
3
|
+
a70cb5d0dca21f5c4291bfbb95a45340a9a257ebc5094cd98ff8abf8bfb8fc2d devzone-darwin-amd64
|
|
4
|
+
d7998a54299c3490fadc204d4cb9a868948a99796ca55e3129d3a89d621c11ba devzone-darwin-arm64
|
|
5
|
+
ad8bc862fdbd82871f3e5353099b70b32b2bd3f1a9cd9b4d07f4e146ed6063b1 devzone-windows-amd64.exe
|
|
6
|
+
085063a5d7728143291a12f6546ea670a3c8492616f89043cd7cdd786d530971 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
|
@@ -26,7 +26,7 @@ PAQUET="$(cd "$(dirname "$(readlink -f "$SCRIPT" 2>/dev/null || echo "$SCRIPT")"
|
|
|
26
26
|
PACKAGE_ITEMS=(.devcontainer Makefile .gitattributes README.md LICENSE)
|
|
27
27
|
# Lines always present in the .gitignore of a devzone: added to, never overwritten
|
|
28
28
|
GITIGNORE_LINES=(
|
|
29
|
-
'#
|
|
29
|
+
'# Each workspace project has its own git repository'
|
|
30
30
|
'workspace/*'
|
|
31
31
|
'!workspace/.gitkeep'
|
|
32
32
|
'.DS_Store'
|
|
@@ -161,10 +161,10 @@ devzone $(version): development workspace in a Kubernetes cluster
|
|
|
161
161
|
in a devzone folder: replaces the package files with those of
|
|
162
162
|
the installed package, after backing up the replaced files in
|
|
163
163
|
.devzone.backup/ (the new image is used at the next workspace start)
|
|
164
|
-
devzone uninstall
|
|
165
|
-
folder
|
|
166
|
-
|
|
167
|
-
workspace/ is kept
|
|
164
|
+
devzone uninstall [--yes]
|
|
165
|
+
in a devzone folder: removes Kubernetes objects of this devzone
|
|
166
|
+
instance (namespaces, Argo CD Applications, temporary accounts,
|
|
167
|
+
.devzone.* files); workspace/ is kept; asks for confirmation
|
|
168
168
|
devzone workspace start|stop|status|shell|update
|
|
169
169
|
devzone workspace vscode|copy-to|copy-from|clone
|
|
170
170
|
Kubernetes workspace: drives the devzone-workspace chart
|
|
@@ -173,7 +173,6 @@ devzone $(version): development workspace in a Kubernetes cluster
|
|
|
173
173
|
services (gitlab, postgres, argocd) of the Kubernetes workspace
|
|
174
174
|
devzone workspace argocd status|init|apply|app add|list|remove
|
|
175
175
|
Argo CD of the workspace: GitOps repository, .argocd.conf, projects
|
|
176
|
-
(old French names: refused with the new name, see the README, « Removed names »)
|
|
177
176
|
devzone --version
|
|
178
177
|
EOT
|
|
179
178
|
}
|
|
@@ -192,18 +191,6 @@ container_command() {
|
|
|
192
191
|
|
|
193
192
|
go_launch "$@"
|
|
194
193
|
|
|
195
|
-
# Renamed names (#695): the French names of the host and container commands are
|
|
196
|
-
# refused before anything is created (« devzone mettre-a-jour » must not create a
|
|
197
|
-
# folder; « devzone stop » still creates ./stop). A copied devzone may miss the
|
|
198
|
-
# aliases file: then no check.
|
|
199
|
-
# shellcheck source=SCRIPTDIR/../.devcontainer/command-aliases.sh
|
|
200
|
-
# shellcheck disable=SC1091
|
|
201
|
-
if [ -f "$PAQUET/.devcontainer/command-aliases.sh" ]; then
|
|
202
|
-
. "$PAQUET/.devcontainer/command-aliases.sh"
|
|
203
|
-
reject_renamed "$@" || exit 1
|
|
204
|
-
fi
|
|
205
|
-
|
|
206
|
-
|
|
207
194
|
case "${1:-}" in
|
|
208
195
|
"" | -h | --help | help) show_help ;;
|
|
209
196
|
-v | --version) version ;;
|
|
@@ -224,7 +211,7 @@ case "${1:-}" in
|
|
|
224
211
|
done
|
|
225
212
|
fi
|
|
226
213
|
if [ -z "$uninstaller" ]; then
|
|
227
|
-
echo "✖
|
|
214
|
+
echo "✖ Run this in a devzone folder (uninstall.sh not found here)." >&2
|
|
228
215
|
exit 1
|
|
229
216
|
fi
|
|
230
217
|
DEVZONE_COMMAND="devzone uninstall" bash "$uninstaller"
|
|
@@ -238,7 +225,7 @@ case "${1:-}" in
|
|
|
238
225
|
;;
|
|
239
226
|
*)
|
|
240
227
|
if container_command "$1"; then
|
|
241
|
-
echo "✖ devzone $1
|
|
228
|
+
echo "✖ devzone $1: pod command; run it in the pod (make shell), or choose another folder name" >&2
|
|
242
229
|
exit 2
|
|
243
230
|
fi
|
|
244
231
|
# shellcheck source=SCRIPTDIR/scripts/devzone-manifest.sh
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# list of French words below. Each fault is printed as "path: word" and the
|
|
5
5
|
# run exits 1; otherwise it prints "names check: N paths ok" and exits 0.
|
|
6
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
|
|
8
|
-
#
|
|
7
|
+
# checks) and the names listed in ALLOWED (user data kept under its name).
|
|
8
|
+
# bash 3.2 (macOS).
|
|
9
9
|
|
|
10
10
|
set -u
|
|
11
11
|
|
|
@@ -13,13 +13,12 @@ ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
13
13
|
ROOT="$(cd "$ICI/../../.." && pwd)"
|
|
14
14
|
|
|
15
15
|
# French words that must not appear in a name. Split fragments, so this file
|
|
16
|
-
# does not match its own rules (the check
|
|
16
|
+
# does not match its own rules (as in the English code check).
|
|
17
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
18
|
FRENCH="$(printf '%s' "$FRENCH" | tr -d '_')"
|
|
19
19
|
|
|
20
|
-
# Names of the user data kept as they are
|
|
21
|
-
|
|
22
|
-
ALLOWED=" .devzone.modules .devzone.version .devcontainer/rename-legacy-files.sh "
|
|
20
|
+
# Names of the user data kept as they are
|
|
21
|
+
ALLOWED=" .devzone.modules .devzone.version "
|
|
23
22
|
|
|
24
23
|
if ! paths="$(git -C "$ROOT" ls-files --cached --others --exclude-standard)"; then
|
|
25
24
|
echo "check-names: git ls-files fails in $ROOT" >&2
|
|
@@ -45,7 +45,7 @@ notes_of() {
|
|
|
45
45
|
|
|
46
46
|
# Title of the ticket and of the commit for the bump of tool $1 from $2 to $3
|
|
47
47
|
title_of() {
|
|
48
|
-
echo "$1 $2 → $3
|
|
48
|
+
echo "$1 $2 → $3 in the image"
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
# "number<TAB>title" of the open ticket of AUTHOR for tool $1, nothing otherwise
|
|
@@ -33,16 +33,16 @@ create_workstation() {
|
|
|
33
33
|
--gitops) expect=gitops ;;
|
|
34
34
|
--gitops=*) gitops="${arg#--gitops=}" ;;
|
|
35
35
|
--kubernetes) option=kubernetes ;;
|
|
36
|
-
*) echo "✖ option
|
|
36
|
+
*) echo "✖ unknown option: $arg (devzone <folder> [--gitops github|none|<url>] [--kubernetes])" >&2; exit 1 ;;
|
|
37
37
|
esac
|
|
38
38
|
done
|
|
39
39
|
if [ -n "$expect" ]; then
|
|
40
|
-
echo "✖ --gitops
|
|
40
|
+
echo "✖ --gitops expects a value (github, none or a URL)" >&2
|
|
41
41
|
exit 1
|
|
42
42
|
fi
|
|
43
43
|
|
|
44
44
|
if [ -e "$target" ] && [ -n "$(ls -A "$target" 2>/dev/null)" ]; then
|
|
45
|
-
echo "✖ $target
|
|
45
|
+
echo "✖ $target exists and is not empty: nothing is overwritten. Choose another folder." >&2
|
|
46
46
|
exit 1
|
|
47
47
|
fi
|
|
48
48
|
|
|
@@ -104,7 +104,7 @@ create_workstation() {
|
|
|
104
104
|
esac
|
|
105
105
|
target="$(cd "$target" && pwd)"
|
|
106
106
|
write_manifest "$target"
|
|
107
|
-
echo "✔ devzone $(version)
|
|
107
|
+
echo "✔ devzone $(version) created in $target"
|
|
108
108
|
# The workspace goes to the cluster (kube check done by create_mode_choose)
|
|
109
109
|
create_mode_start "$target" "$PAQUET/manage/workspace.sh"
|
|
110
110
|
}
|
|
@@ -35,7 +35,7 @@ update_workstation() {
|
|
|
35
35
|
esac
|
|
36
36
|
done
|
|
37
37
|
if [ ! -d .devcontainer ]; then
|
|
38
|
-
echo "✖
|
|
38
|
+
echo "✖ Run this in a devzone folder (.devcontainer not found here)." >&2
|
|
39
39
|
exit 1
|
|
40
40
|
fi
|
|
41
41
|
|
|
@@ -55,11 +55,11 @@ update_workstation() {
|
|
|
55
55
|
[ -f "$folder/$rel" ] || missing=1
|
|
56
56
|
done <"$package_list"
|
|
57
57
|
if [ "$installed" = "$package" ] && [ -z "$missing" ]; then
|
|
58
|
-
echo "✔ devzone $installed
|
|
59
|
-
echo "
|
|
58
|
+
echo "✔ devzone $installed: already up to date."
|
|
59
|
+
echo "For the latest published version: npx devzone@latest update"
|
|
60
60
|
return 0
|
|
61
61
|
fi
|
|
62
|
-
echo "devzone
|
|
62
|
+
echo "devzone: folder $installed, package $package"
|
|
63
63
|
|
|
64
64
|
# 2. Files modified locally (checksum different from the manifest; without
|
|
65
65
|
# a manifest, different from the one of the package)
|
|
@@ -81,13 +81,13 @@ update_workstation() {
|
|
|
81
81
|
while IFS= read -r rel; do
|
|
82
82
|
[ -n "$rel" ] || continue
|
|
83
83
|
if ! path_allowed "$rel"; then
|
|
84
|
-
echo "devzone
|
|
84
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
85
85
|
continue
|
|
86
86
|
fi
|
|
87
87
|
in_list "$package_list" "$rel" && continue
|
|
88
88
|
is_protected "$rel" && continue
|
|
89
89
|
if ! inside_folder "$folder" "$rel"; then
|
|
90
|
-
echo "devzone
|
|
90
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
91
91
|
continue
|
|
92
92
|
fi
|
|
93
93
|
printf '%s\n' "$rel" >>"$work/to_remove"
|
|
@@ -106,7 +106,7 @@ update_workstation() {
|
|
|
106
106
|
while IFS= read -r f; do
|
|
107
107
|
rel="${f#"$folder"/}"
|
|
108
108
|
if ! path_allowed "$rel"; then
|
|
109
|
-
echo "devzone
|
|
109
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
110
110
|
continue
|
|
111
111
|
fi
|
|
112
112
|
is_protected "$rel" && continue
|
|
@@ -125,13 +125,13 @@ update_workstation() {
|
|
|
125
125
|
mv "$work/to_save.sorted" "$work/to_save"
|
|
126
126
|
|
|
127
127
|
if [ -s "$work/modified" ]; then
|
|
128
|
-
echo "
|
|
128
|
+
echo "Locally modified files:"
|
|
129
129
|
while IFS= read -r rel; do
|
|
130
130
|
printf ' %s\n' "$rel"
|
|
131
131
|
done <"$work/modified"
|
|
132
132
|
if [ -z "$assume_yes" ]; then
|
|
133
133
|
if [ ! -t 0 ]; then
|
|
134
|
-
echo "✖
|
|
134
|
+
echo "✖ Locally modified files: rerun with --yes to replace them (backup in .devzone.backup/)." >&2
|
|
135
135
|
exit 1
|
|
136
136
|
fi
|
|
137
137
|
printf 'Replace these files (backup in .devzone.backup/)? [y/N] ' >&2
|
|
@@ -139,17 +139,13 @@ update_workstation() {
|
|
|
139
139
|
case "$answer" in
|
|
140
140
|
y | Y | yes) ;;
|
|
141
141
|
*)
|
|
142
|
-
echo "
|
|
142
|
+
echo "Aborted: nothing was modified."
|
|
143
143
|
return 1
|
|
144
144
|
;;
|
|
145
145
|
esac
|
|
146
146
|
fi
|
|
147
147
|
fi
|
|
148
148
|
|
|
149
|
-
# Former French names renamed before the backup (#733): the backup folder is
|
|
150
|
-
# .devzone.backup. The script comes from the package, the folder may be old
|
|
151
|
-
DEVZONE_ROOT="$folder" bash "$PAQUET/.devcontainer/rename-legacy-files.sh" || true
|
|
152
|
-
|
|
153
149
|
# 3. Backup of every file replaced or removed
|
|
154
150
|
if [ -s "$work/to_save" ]; then
|
|
155
151
|
base="$folder/.devzone.backup/$(date +%Y%m%d-%H%M%S)"
|
|
@@ -162,7 +158,7 @@ update_workstation() {
|
|
|
162
158
|
while IFS= read -r rel; do
|
|
163
159
|
[ -f "$folder/$rel" ] || continue
|
|
164
160
|
if ! inside_folder "$folder" "$rel"; then
|
|
165
|
-
echo "devzone
|
|
161
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
166
162
|
continue
|
|
167
163
|
fi
|
|
168
164
|
mkdir -p "$backup/$(dirname "$rel")"
|
|
@@ -178,13 +174,13 @@ update_workstation() {
|
|
|
178
174
|
while IFS= read -r rel; do
|
|
179
175
|
mkdir -p "$folder/$(dirname "$rel")"
|
|
180
176
|
if ! inside_folder "$folder" "$rel"; then
|
|
181
|
-
echo "devzone
|
|
177
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
182
178
|
continue
|
|
183
179
|
fi
|
|
184
180
|
# Never write through a link: the link (not its target) is removed
|
|
185
181
|
if [ -L "$folder/$rel" ]; then
|
|
186
182
|
rm -f -- "$folder/$rel"
|
|
187
|
-
echo "devzone
|
|
183
|
+
echo "devzone: manifest: link replaced: $rel" >&2
|
|
188
184
|
fi
|
|
189
185
|
cp -p "$PAQUET/$rel" "$folder/$rel"
|
|
190
186
|
if [ -x "$PAQUET/$rel" ]; then
|
|
@@ -195,7 +191,7 @@ update_workstation() {
|
|
|
195
191
|
[ -n "$rel" ] || continue
|
|
196
192
|
[ -f "$folder/$rel" ] || continue
|
|
197
193
|
if ! inside_folder "$folder" "$rel"; then
|
|
198
|
-
echo "devzone
|
|
194
|
+
echo "devzone: manifest: refused path: $rel" >&2
|
|
199
195
|
continue
|
|
200
196
|
fi
|
|
201
197
|
# rm does not follow links: only the link is removed, never its target
|
|
@@ -210,18 +206,18 @@ update_workstation() {
|
|
|
210
206
|
|
|
211
207
|
# 6. New manifest, then rebuild offered
|
|
212
208
|
write_manifest "$folder"
|
|
213
|
-
echo "✔ devzone $package
|
|
209
|
+
echo "✔ devzone $package: updated."
|
|
214
210
|
restart_ports_watcher "$folder"
|
|
215
211
|
# the update never changes the workstation mode (#472)
|
|
216
212
|
if [ "$(grep -E '^workspace=' "$folder/.devzone.modules" 2>/dev/null | tail -1)" = "workspace=kubernetes" ]; then
|
|
217
213
|
return 0
|
|
218
214
|
fi
|
|
219
215
|
if [ -n "$no_rebuild" ]; then
|
|
220
|
-
echo "
|
|
216
|
+
echo "Rebuild not started (--no-rebuild)."
|
|
221
217
|
return 0
|
|
222
218
|
fi
|
|
223
219
|
if [ ! -t 0 ]; then
|
|
224
|
-
echo "
|
|
220
|
+
echo "Rebuild: make -C $folder rebuild (run in a terminal)"
|
|
225
221
|
return 0
|
|
226
222
|
fi
|
|
227
223
|
printf 'Rebuild the container now? [y/N] ' >&2
|
|
@@ -229,7 +225,7 @@ update_workstation() {
|
|
|
229
225
|
case "$answer" in
|
|
230
226
|
y | Y | yes) ;;
|
|
231
227
|
*)
|
|
232
|
-
echo "
|
|
228
|
+
echo "Rebuild not started: make -C $folder rebuild"
|
|
233
229
|
return 0
|
|
234
230
|
;;
|
|
235
231
|
esac
|
|
@@ -155,7 +155,7 @@ argocd_toggle() {
|
|
|
155
155
|
# devzone workspace argocd status | app …
|
|
156
156
|
argocd_cmd() {
|
|
157
157
|
case "${1:-status}" in
|
|
158
|
-
status
|
|
158
|
+
status) argocd_status ;;
|
|
159
159
|
init)
|
|
160
160
|
gitops_init "${@:2}" || return $?
|
|
161
161
|
if argocd_installed; then gitops_root; fi
|
|
@@ -131,8 +131,8 @@ 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_ROOT="$PWD" bash "$RACINE/.devcontainer/password.sh"
|
|
135
|
-
echo "⚠ .password not updated (bash .devcontainer/password.sh
|
|
134
|
+
DEVZONE_ROOT="$PWD" bash "$RACINE/.devcontainer/password.sh" regenerate 2>/dev/null ||
|
|
135
|
+
echo "⚠ .password not updated (bash .devcontainer/password.sh regenerate)" >&2
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
# Installs Argo CD (pinned chart and values), idempotent (upgrade --install)
|
|
@@ -213,9 +213,9 @@ ports_status() {
|
|
|
213
213
|
# Subcommand "devzone workspace ports [start|stop|status]" (default: status).
|
|
214
214
|
ports() {
|
|
215
215
|
case "${1:-status}" in
|
|
216
|
-
start
|
|
217
|
-
stop
|
|
218
|
-
status
|
|
216
|
+
start) ports_start ;;
|
|
217
|
+
stop) ports_stop ;;
|
|
218
|
+
status) ports_status ;;
|
|
219
219
|
*) echo "✖ devzone workspace ports start|stop|status" >&2; return 1 ;;
|
|
220
220
|
esac
|
|
221
221
|
}
|
|
@@ -229,7 +229,7 @@ ports_etat() { ports_status "$@"; }
|
|
|
229
229
|
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
|
230
230
|
pw_guard quiet || exit 2
|
|
231
231
|
case "${1:-}" in
|
|
232
|
-
loop
|
|
233
|
-
round
|
|
232
|
+
loop) pw_loop ;;
|
|
233
|
+
round) pw_round ;;
|
|
234
234
|
esac
|
|
235
235
|
fi
|
|
@@ -173,8 +173,8 @@ services_status() {
|
|
|
173
173
|
services() {
|
|
174
174
|
local sub="${1:-}"
|
|
175
175
|
case "$sub" in
|
|
176
|
-
enable
|
|
177
|
-
disable
|
|
176
|
+
enable) services_run enable "${2:-}" "${@:3}" ;;
|
|
177
|
+
disable) services_run disable "${2:-}" "${@:3}" ;;
|
|
178
178
|
# The data of gitlab (group, demo project, dev user, runner) seeded
|
|
179
179
|
# again, in the pod (#538): the only seed of the services
|
|
180
180
|
seed)
|
|
@@ -184,7 +184,7 @@ services() {
|
|
|
184
184
|
fi
|
|
185
185
|
services_run seed gitlab
|
|
186
186
|
;;
|
|
187
|
-
status |
|
|
187
|
+
status | '') services_status ;;
|
|
188
188
|
*)
|
|
189
189
|
echo "✖ unknown subcommand: $sub ($(services_usage))" >&2
|
|
190
190
|
return 1
|
|
@@ -96,9 +96,6 @@ update_workspace() {
|
|
|
96
96
|
;;
|
|
97
97
|
esac
|
|
98
98
|
fi
|
|
99
|
-
# Former French names renamed once the update is confirmed (#733); the
|
|
100
|
-
# script comes from the package, the devzone folder is the current one
|
|
101
|
-
DEVZONE_ROOT="$PWD" bash "$ROOT/.devcontainer/rename-legacy-files.sh" || true
|
|
102
99
|
# Same path as workspace start, at the release: Argo CD revision and image tag
|
|
103
100
|
export DEVZONE_ARGOCD_REVISION="v$version"
|
|
104
101
|
workspace_deploy "$IMAGE_REPO" "$version" ""
|
package/manage/workspace.sh
CHANGED
|
@@ -141,20 +141,6 @@ shell_workspace() {
|
|
|
141
141
|
# shellcheck source=manage/scripts/workspace/workspace-egress.sh
|
|
142
142
|
. "$HERE/scripts/workspace/workspace-egress.sh"
|
|
143
143
|
|
|
144
|
-
# Renamed names (#695): an old French name is refused before anything runs, with
|
|
145
|
-
# its English name (« devzone workspace start »). A copied devzone may miss the
|
|
146
|
-
# aliases file: then no check.
|
|
147
|
-
# shellcheck source=../.devcontainer/command-aliases.sh
|
|
148
|
-
# shellcheck disable=SC1091
|
|
149
|
-
if [ -f "$ROOT/.devcontainer/command-aliases.sh" ]; then
|
|
150
|
-
. "$ROOT/.devcontainer/command-aliases.sh"
|
|
151
|
-
reject_renamed workspace "$@" || exit 1
|
|
152
|
-
if [ "${1:-}" = ports ] && [ "$#" -gt 1 ]; then
|
|
153
|
-
reject_renamed "workspace ports" "${@:2}" || exit 1
|
|
154
|
-
fi
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
|
|
158
144
|
case "${1:-}" in
|
|
159
145
|
start) start_workspace "${@:2}" ;;
|
|
160
146
|
update) update_workspace "${@:2}" ;;
|