devzone 2.0.0 → 4.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/agent-errors.sh +6 -6
- package/.devcontainer/agent-pod-manifest.sh +4 -4
- package/.devcontainer/agent-session.sh +2 -2
- package/.devcontainer/agent-state-json.sh +2 -2
- package/.devcontainer/agent-workspace.sh +1 -1
- package/.devcontainer/agent.sh +7 -7
- package/.devcontainer/ai/host-models.sh +2 -2
- package/.devcontainer/ai/plugins/devzone-guard-v2.js +3 -3
- package/.devcontainer/ai/plugins/devzone-guard.js +3 -3
- package/.devcontainer/argocd/argocd.sh +90 -89
- package/.devcontainer/argocd/catalog-argocd.sh +2 -2
- package/.devcontainer/argocd/services-hook.sh +3 -3
- package/.devcontainer/argocd/services.sh +1 -1
- package/.devcontainer/catalog/app.sh +114 -116
- package/.devcontainer/catalog/catalog-watcher.sh +62 -62
- package/.devcontainer/catalog/mysql/app.conf +1 -1
- package/.devcontainer/catalog/mysql/install.sh +40 -40
- package/.devcontainer/catalog/mysql/mysql.sh +141 -141
- package/.devcontainer/catalog/mysql/volume.sh +39 -39
- package/.devcontainer/catalog.sh +112 -112
- package/.devcontainer/chart-direct.sh +1 -1
- package/.devcontainer/cluster.sh +216 -218
- package/.devcontainer/clusters.sh +41 -41
- package/.devcontainer/command-aliases.sh +17 -8
- package/.devcontainer/devzone +93 -1496
- package/.devcontainer/devzone-ai-guard.sh +76 -0
- package/.devcontainer/devzone-ai.sh +201 -0
- package/.devcontainer/devzone-cluster.sh +210 -0
- package/.devcontainer/devzone-modules.sh +126 -0
- package/.devcontainer/devzone-platform.sh +189 -0
- package/.devcontainer/devzone-repair.sh +94 -0
- package/.devcontainer/devzone-services.sh +241 -0
- package/.devcontainer/devzone-skill.sh +97 -0
- package/.devcontainer/devzone-status.sh +140 -0
- package/.devcontainer/devzone-version.sh +78 -0
- package/.devcontainer/git-identity.sh +28 -0
- package/.devcontainer/gitlab/chart.sh +2 -2
- package/.devcontainer/gitlab/gitlab.sh +81 -82
- package/.devcontainer/gitlab/installation.sh +109 -109
- package/.devcontainer/gitlab/secrets.sh +47 -47
- package/.devcontainer/gitlab/seed.sh +77 -77
- package/.devcontainer/gitlab/test-gitlab.sh +242 -243
- package/.devcontainer/help.sh +1 -1
- package/.devcontainer/isolation.sh +30 -30
- package/.devcontainer/kind-wrapper.sh +17 -17
- package/.devcontainer/kube-account.sh +112 -113
- package/.devcontainer/kube-config.sh +45 -46
- package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
- package/.devcontainer/kube-reachable.sh +40 -40
- package/.devcontainer/memory.sh +1 -1
- package/.devcontainer/metrics-server.sh +2 -2
- package/.devcontainer/opencode.jsonc +2 -2
- package/.devcontainer/packages.sh +136 -135
- package/.devcontainer/password.sh +1 -1
- package/.devcontainer/ports-auto.sh +152 -153
- package/.devcontainer/ports-json.sh +16 -15
- package/.devcontainer/ports.sh +126 -122
- package/.devcontainer/post-create.sh +52 -52
- package/.devcontainer/postgres/postgres.sh +174 -174
- package/.devcontainer/rename-legacy-files.sh +103 -0
- package/.devcontainer/services-admin.sh +3 -3
- package/.devcontainer/skills/devzone/SKILL.md +40 -41
- package/.devcontainer/startup.sh +48 -49
- package/.devcontainer/state-gitops.sh +1 -1
- package/.devcontainer/state-json.sh +36 -62
- package/.devcontainer/state.sh +2 -2
- package/.devcontainer/workspace-init.sh +16 -2
- package/Makefile +1 -1
- package/README.md +191 -195
- package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
- package/manage/devzone +7 -11
- package/manage/scripts/argocd-workspace.sh +1 -1
- package/manage/scripts/{check-charts.sh → ci/check-charts.sh} +1 -1
- package/manage/scripts/{check-english.sh → ci/check-english.sh} +1 -1
- package/manage/scripts/{check-go-layout.sh → ci/check-go-layout.sh} +1 -1
- package/manage/scripts/{check-names.sh → ci/check-names.sh} +7 -6
- package/manage/scripts/{check-utf8-vars.sh → ci/check-utf8-vars.sh} +1 -1
- package/manage/scripts/{versions.sh → ci/versions.sh} +8 -8
- package/manage/scripts/create-cluster.sh +1 -1
- package/manage/scripts/create-mode.sh +11 -18
- package/manage/scripts/devzone-create.sh +7 -35
- package/manage/scripts/devzone-manifest.sh +1 -1
- package/manage/scripts/devzone-update.sh +12 -8
- package/manage/scripts/launch.sh +7 -48
- package/manage/scripts/ports-apps.sh +1 -1
- package/manage/scripts/ports-workspace.sh +7 -7
- package/manage/scripts/poste.sh +6 -7
- package/manage/scripts/uninstall.sh +8 -8
- package/manage/scripts/workspace-egress.sh +2 -2
- package/manage/scripts/workspace-update.sh +5 -2
- package/manage/scripts/workspace-wait.sh +2 -2
- package/manage/workspace.sh +2 -12
- package/package.json +1 -1
- package/.devcontainer/docker-relay.sh +0 -149
- package/.devcontainer/docker-without-host.sh +0 -12
- package/.devcontainer/git-identite.sh +0 -28
- package/manage/scripts/docker-workstation.sh +0 -73
- package/manage/scripts/migrate-revert.sh +0 -60
- package/manage/scripts/migrate.sh +0 -243
- /package/manage/scripts/{ci-dns.sh → ci/ci-dns.sh} +0 -0
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# View of the connected clusters (#337): visible contexts, type, state, namespace.
|
|
3
3
|
ICI="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
-
if ! declare -F
|
|
4
|
+
if ! declare -F cluster_is_local >/dev/null 2>&1; then
|
|
5
5
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
6
6
|
# shellcheck disable=SC1091
|
|
7
7
|
. "$ICI/cluster.sh"
|
|
8
8
|
fi
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
local
|
|
13
|
-
|
|
14
|
-
ctx_services="$(
|
|
10
|
+
# Shows the view of the connected clusters.
|
|
11
|
+
clusters_show() {
|
|
12
|
+
local contexts=() ctx ctx_work ctx_services tmp i ns type state mark marks
|
|
13
|
+
ctx_work="$(kubectl config current-context 2>/dev/null || true)"
|
|
14
|
+
ctx_services="$(cluster_saved 2>/dev/null || true)"
|
|
15
15
|
while IFS= read -r ctx; do
|
|
16
16
|
[ -n "$ctx" ] || continue
|
|
17
|
-
|
|
17
|
+
contexts+=("$ctx")
|
|
18
18
|
done < <(kubectl config get-contexts -o name 2>/dev/null || true)
|
|
19
19
|
|
|
20
|
-
if [ "${#
|
|
21
|
-
echo "
|
|
20
|
+
if [ "${#contexts[@]}" -eq 0 ]; then
|
|
21
|
+
echo "no cluster: kind create cluster, or devzone enable kubernetes"
|
|
22
22
|
return 0
|
|
23
23
|
fi
|
|
24
24
|
|
|
25
|
-
printf '%s %-14s %-8s %-12s %s\n' " " "
|
|
25
|
+
printf '%s %-14s %-8s %-12s %s\n' " " "CONTEXT" "TYPE" "STATE" "NAMESPACE"
|
|
26
26
|
tmp="$(mktemp -d)"
|
|
27
|
-
for i in "${!
|
|
28
|
-
ctx="${
|
|
27
|
+
for i in "${!contexts[@]}"; do
|
|
28
|
+
ctx="${contexts[$i]}"
|
|
29
29
|
(
|
|
30
30
|
if kubectl --context "$ctx" --request-timeout=3s get --raw /readyz >/dev/null 2>&1; then
|
|
31
|
-
echo
|
|
31
|
+
echo reachable
|
|
32
32
|
else
|
|
33
|
-
echo
|
|
33
|
+
echo unreachable
|
|
34
34
|
fi
|
|
35
35
|
) >"$tmp/$i" &
|
|
36
36
|
done
|
|
37
37
|
wait
|
|
38
|
-
for i in "${!
|
|
39
|
-
ctx="${
|
|
40
|
-
|
|
41
|
-
if
|
|
38
|
+
for i in "${!contexts[@]}"; do
|
|
39
|
+
ctx="${contexts[$i]}"
|
|
40
|
+
state="$(cat "$tmp/$i" 2>/dev/null || echo unreachable)"
|
|
41
|
+
if cluster_is_local "$ctx" >/dev/null 2>&1; then
|
|
42
42
|
type=local
|
|
43
43
|
else
|
|
44
|
-
type=
|
|
44
|
+
type=remote
|
|
45
45
|
fi
|
|
46
46
|
ns="$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"$ctx\")].context.namespace}" 2>/dev/null || true)"
|
|
47
47
|
[ -n "$ns" ] || ns=default
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if [ "$ctx" = "$
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
mark=""
|
|
49
|
+
marks=0
|
|
50
|
+
if [ "$ctx" = "$ctx_work" ]; then
|
|
51
|
+
mark+="★"
|
|
52
|
+
marks=$((marks + 1))
|
|
53
53
|
fi
|
|
54
54
|
if [ "$ctx" = "$ctx_services" ]; then
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
mark+="●"
|
|
56
|
+
marks=$((marks + 1))
|
|
57
57
|
fi
|
|
58
|
-
while [ "$
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
while [ "$marks" -lt 2 ]; do
|
|
59
|
+
mark+=" "
|
|
60
|
+
marks=$((marks + 1))
|
|
61
61
|
done
|
|
62
|
-
printf '%s %-14s %-8s %-12s %s\n' "$
|
|
62
|
+
printf '%s %-14s %-8s %-12s %s\n' "$mark" "$ctx" "$type" "$state" "$ns"
|
|
63
63
|
done
|
|
64
64
|
rm -rf "$tmp"
|
|
65
65
|
echo
|
|
66
|
-
echo "★ cluster
|
|
67
|
-
#
|
|
68
|
-
if [ -n "$ctx_services" ] &&
|
|
66
|
+
echo "★ working cluster (kubectl, k9s, helm) · ● devzone services cluster (devzone cluster)"
|
|
67
|
+
# Display of the NetworkPolicy isolation state for the services cluster
|
|
68
|
+
if [ -n "$ctx_services" ] && cluster_is_local "$ctx_services"; then
|
|
69
69
|
if kubectl --context "$ctx_services" get networkpolicy devzone-meme-namespace -n devzone-postgres >/dev/null 2>&1; then
|
|
70
|
-
printf ' ✔
|
|
70
|
+
printf ' ✔ isolated (NetworkPolicy) → %s\n' "$ctx_services"
|
|
71
71
|
else
|
|
72
|
-
printf ' ⚠
|
|
72
|
+
printf ' ⚠ isolated (NetworkPolicy missing) → %s\n' "$ctx_services"
|
|
73
73
|
fi
|
|
74
74
|
printf ' devzone → %s\n' "$ctx_services"
|
|
75
75
|
fi
|
|
76
76
|
return 0
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
#
|
|
80
|
-
clusters() {
|
|
81
|
-
# Alias
|
|
82
|
-
devzone_clusters() {
|
|
79
|
+
# Aliases of the devzone clusters command.
|
|
80
|
+
clusters() { clusters_show "$@"; }
|
|
81
|
+
# Alias for the tests and direct calls.
|
|
82
|
+
devzone_clusters() { clusters_show "$@"; }
|
|
83
83
|
|
|
84
84
|
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
|
85
|
-
|
|
85
|
+
clusters_show "$@"
|
|
86
86
|
fi
|
|
@@ -36,9 +36,6 @@ renamed_command() {
|
|
|
36
36
|
desinstaller) echo uninstall ;;
|
|
37
37
|
copier-vers) echo copy-to ;;
|
|
38
38
|
copier-depuis) echo copy-from ;;
|
|
39
|
-
migrer) echo migrate ;;
|
|
40
|
-
revenir) echo revert ;;
|
|
41
|
-
nettoyer-docker) echo clean-docker ;;
|
|
42
39
|
*) return 1 ;;
|
|
43
40
|
esac
|
|
44
41
|
}
|
|
@@ -123,9 +120,6 @@ renamed_subcommand() {
|
|
|
123
120
|
etat) echo status ;;
|
|
124
121
|
copier-vers) echo copy-to ;;
|
|
125
122
|
copier-depuis) echo copy-from ;;
|
|
126
|
-
migrer) echo migrate ;;
|
|
127
|
-
revenir) echo revert ;;
|
|
128
|
-
nettoyer-docker) echo clean-docker ;;
|
|
129
123
|
aide) echo help ;;
|
|
130
124
|
*) return 1 ;;
|
|
131
125
|
esac
|
|
@@ -151,11 +145,17 @@ renamed_option() {
|
|
|
151
145
|
--oui) echo --yes ;;
|
|
152
146
|
--confirmer) echo --confirm ;;
|
|
153
147
|
--contexte) echo --context ;;
|
|
154
|
-
--rapatrier) echo --bring-back ;;
|
|
155
148
|
*) return 1 ;;
|
|
156
149
|
esac
|
|
157
150
|
}
|
|
158
151
|
|
|
152
|
+
# Names removed in 3.0 (#735): refused with the same exit code, with a notice
|
|
153
|
+
# that names no former feature and never creates a folder.
|
|
154
|
+
removed_notice() {
|
|
155
|
+
echo "✖ this command or option was removed in devzone 3.0 (see manage/docs/migrating-to-3.md)" >&2
|
|
156
|
+
return 1
|
|
157
|
+
}
|
|
158
|
+
|
|
159
159
|
# reject_renamed <command> <args...> : checks the command itself (top level),
|
|
160
160
|
# the first word of <args> that is not an option (subcommand), then every
|
|
161
161
|
# option. The first renamed name prints its message on stderr and returns 1;
|
|
@@ -163,10 +163,13 @@ renamed_option() {
|
|
|
163
163
|
reject_renamed() {
|
|
164
164
|
local command="${1:-}" word new
|
|
165
165
|
if [ "$#" -gt 0 ]; then shift; fi
|
|
166
|
+
case "$command" in
|
|
167
|
+
migrer | revenir | nettoyer-docker) removed_notice; return 1 ;;
|
|
168
|
+
esac
|
|
166
169
|
if new="$(renamed_command "$command")"; then
|
|
167
170
|
# these commands only exist under « devzone workspace »
|
|
168
171
|
case "$command" in
|
|
169
|
-
|
|
172
|
+
copier-vers | copier-depuis) new="workspace $new" ;;
|
|
170
173
|
esac
|
|
171
174
|
printf '✖ « %s » a été renommé : devzone %s\n' "$command" "$new" >&2
|
|
172
175
|
return 1
|
|
@@ -175,6 +178,11 @@ reject_renamed() {
|
|
|
175
178
|
case "$word" in
|
|
176
179
|
-*) continue ;;
|
|
177
180
|
esac
|
|
181
|
+
if [ "$command" = workspace ]; then
|
|
182
|
+
case "$word" in
|
|
183
|
+
migrer | revenir | nettoyer-docker) removed_notice; return 1 ;;
|
|
184
|
+
esac
|
|
185
|
+
fi
|
|
178
186
|
if new="$(renamed_subcommand "$command" "$word")"; then
|
|
179
187
|
printf '✖ « %s » a été renommé : devzone %s %s\n' "$word" "$command" "$new" >&2
|
|
180
188
|
return 1
|
|
@@ -183,6 +191,7 @@ reject_renamed() {
|
|
|
183
191
|
done
|
|
184
192
|
for word in "$@"; do
|
|
185
193
|
case "$word" in
|
|
194
|
+
--rapatrier) removed_notice; return 1 ;;
|
|
186
195
|
-*)
|
|
187
196
|
if new="$(renamed_option "$word")"; then
|
|
188
197
|
printf '✖ « %s » a été renommé : %s\n' "$word" "$new" >&2
|