devzone 0.42.1 → 0.44.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-local.sh +45 -0
- package/.devcontainer/agent-workspace.sh +2 -2
- package/.devcontainer/agent.sh +10 -10
- package/.devcontainer/argocd/catalogue-argocd.sh +4 -0
- package/.devcontainer/argocd/gitops-gitlab.sh +127 -0
- package/.devcontainer/argocd/gitops.sh +12 -2
- package/.devcontainer/argocd/services-hook.sh +211 -0
- package/.devcontainer/catalogue/app.sh +7 -8
- package/.devcontainer/catalogue/mysql/installer.sh +9 -8
- package/.devcontainer/catalogue/mysql/mysql.sh +2 -2
- package/.devcontainer/catalogue.sh +1 -1
- package/.devcontainer/chart-direct.sh +49 -0
- package/.devcontainer/devzone +22 -16
- package/.devcontainer/etat-json.sh +3 -3
- package/.devcontainer/gitlab/argocd.sh +54 -0
- package/.devcontainer/gitlab/chart.sh +39 -0
- package/.devcontainer/gitlab/gitlab.sh +11 -168
- package/.devcontainer/gitlab/installation.sh +25 -38
- package/.devcontainer/gitlab/seed.sh +204 -0
- package/.devcontainer/help.sh +2 -0
- package/.devcontainer/llm/llm.sh +250 -0
- package/.devcontainer/llm/opencode.sh +56 -0
- package/.devcontainer/llm/presets.sh +43 -0
- package/.devcontainer/postgres/postgres.sh +5 -3
- package/.devcontainer/services-admin.sh +19 -6
- package/.devcontainer/versions.env +1 -1
- package/README.md +57 -23
- package/charts/devzone-gitlab/Chart.lock +9 -0
- package/charts/devzone-gitlab/Chart.yaml +15 -0
- package/charts/devzone-gitlab/values.yaml +94 -0
- package/charts/devzone-llm/Chart.yaml +6 -0
- package/charts/devzone-llm/templates/deployment.yaml +97 -0
- package/charts/devzone-llm/templates/pvc.yaml +19 -0
- package/charts/devzone-llm/templates/service.yaml +18 -0
- package/charts/devzone-llm/values.yaml +46 -0
- package/charts/devzone-mysql/values.yaml +3 -3
- package/charts/devzone-postgres/values.yaml +2 -2
- package/manage/devzone +1 -1
- package/manage/scripts/check-charts.sh +67 -19
- package/manage/scripts/check-utf8-vars.sh +67 -0
- package/manage/scripts/services-workspace.sh +16 -6
- package/package.json +1 -1
- package/.devcontainer/catalogue/mysql/manifeste.yaml +0 -81
- package/.devcontainer/gitlab/runner-values.yaml +0 -27
- package/.devcontainer/gitlab/values.yaml +0 -83
- package/.devcontainer/postgres/postgres.yaml +0 -84
package/.devcontainer/Dockerfile
CHANGED
|
@@ -29,7 +29,7 @@ ARG BUILDKIT_SHA256_ARM64=a4ad483a33b2f1544c5ccce1c5956c559e1a6e84b8bf6cedd847d6
|
|
|
29
29
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
30
30
|
|
|
31
31
|
# Contrôles shell de repowarden ; jq : lu par son garde-fou des agents IA
|
|
32
|
-
# (repowarden
|
|
32
|
+
# (repowarden guard, module ia), qui sans lui ne vérifie rien
|
|
33
33
|
# Python 3.12 d Ubuntu 24.04, paquets signés par apt, aucun serveur de clés (#464)
|
|
34
34
|
RUN apt-get -o Acquire::Retries=5 update \
|
|
35
35
|
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends shellcheck bats jq python3 python3-venv python3-pip python-is-python3 \
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Local model in the rotation of devzone agent (#586), sourced by agent.sh.
|
|
3
|
+
# The model devzone-llm/local comes after every online model (never first, never
|
|
4
|
+
# when the module llm is off or the server does not answer /health): it is used
|
|
5
|
+
# when the online ones are all set aside (quota, network). Its internal name has
|
|
6
|
+
# no slash (a file ecart-<name> is written for it); opencode gets the reference.
|
|
7
|
+
LOCAL_NOM=devzone-llm-local
|
|
8
|
+
|
|
9
|
+
# Prints LOCAL_NOM when the module is on (in the pod: the cluster answers) and
|
|
10
|
+
# the server answers /health
|
|
11
|
+
local_pret() {
|
|
12
|
+
local url
|
|
13
|
+
if [ "${DEVZONE_WORKSPACE:-}" != kubernetes ]; then
|
|
14
|
+
bash "$ICI/devzone" is-enabled llm >/dev/null 2>&1 || return 0
|
|
15
|
+
fi
|
|
16
|
+
url="$(bash "$ICI/llm/opencode.sh" url)" || return 0
|
|
17
|
+
curl -fsS --max-time 3 "${url%/v1}/health" >/dev/null 2>&1 && echo "$LOCAL_NOM"
|
|
18
|
+
return 0
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Sets LOCAL_MODELE for this attempt (local_pret), read by modele_au_rang and
|
|
22
|
+
# modeles_total
|
|
23
|
+
local_charge() {
|
|
24
|
+
LOCAL_MODELE="$(local_pret)"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# Model reference given to opencode -m
|
|
28
|
+
modele_ref() {
|
|
29
|
+
if [ "$1" = "$LOCAL_NOM" ]; then echo devzone-llm/local; else echo "opencode/$1"; fi
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Model of rank $1 in the attempt that starts at $2: online ones in rotation,
|
|
33
|
+
# then the local one
|
|
34
|
+
modele_au_rang() {
|
|
35
|
+
if [ "$1" -lt "${#FREE_MODELS[@]}" ]; then
|
|
36
|
+
echo "${FREE_MODELS[$(( ($2 + $1) % ${#FREE_MODELS[@]} ))]}"
|
|
37
|
+
else
|
|
38
|
+
echo "$LOCAL_MODELE"
|
|
39
|
+
fi
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Number of models to try: the online ones, plus the local one if ready
|
|
43
|
+
modeles_total() {
|
|
44
|
+
echo $(( ${#FREE_MODELS[@]} + ${#LOCAL_MODELE} / ${#LOCAL_NOM} ))
|
|
45
|
+
}
|
|
@@ -27,7 +27,7 @@ opencode_lancer() {
|
|
|
27
27
|
if agent_dans_pod; then
|
|
28
28
|
# Dans le pod, le compte de service limité est le seul accès : aucun
|
|
29
29
|
# kubeconfig du poste n'entre dans l'environnement d'opencode.
|
|
30
|
-
(cd "$dossier" && env -u KUBECONFIG DEVZONE_AGENT_SESSION=1 opencode run --print-logs --log-level ERROR --auto -m "
|
|
30
|
+
(cd "$dossier" && env -u KUBECONFIG DEVZONE_AGENT_SESSION=1 opencode run --print-logs --log-level ERROR --auto -m "$(modele_ref "$m")" "$(cat "$consigne")" </dev/null >>"$journal" 2>&1) &
|
|
31
31
|
else
|
|
32
32
|
if [ -f "$HOME/.kube/config" ]; then
|
|
33
33
|
(umask 077; KUBECONFIG="$HOME/.kube/config" kubectl config view --minify --flatten --context devzone >"$agent_kube") 2>/dev/null || : >"$agent_kube"
|
|
@@ -36,7 +36,7 @@ opencode_lancer() {
|
|
|
36
36
|
else
|
|
37
37
|
: >"$agent_kube"
|
|
38
38
|
fi
|
|
39
|
-
(cd "$dossier" && KUBECONFIG="$agent_kube" DEVZONE_AGENT_SESSION=1 opencode run --print-logs --log-level ERROR --auto -m "
|
|
39
|
+
(cd "$dossier" && KUBECONFIG="$agent_kube" DEVZONE_AGENT_SESSION=1 opencode run --print-logs --log-level ERROR --auto -m "$(modele_ref "$m")" "$(cat "$consigne")" </dev/null >>"$journal" 2>&1) &
|
|
40
40
|
fi
|
|
41
41
|
}
|
|
42
42
|
|
package/.devcontainer/agent.sh
CHANGED
|
@@ -23,21 +23,20 @@ ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
|
23
23
|
# shellcheck disable=SC2034 # lue par agent-session.sh
|
|
24
24
|
RACINE="${DEVZONE_RACINE:-$(dirname "$ICI")}"
|
|
25
25
|
# Écarts de modèles et attente du réseau (#328)
|
|
26
|
-
# shellcheck source=agent-erreurs.sh
|
|
27
|
-
# shellcheck disable=SC1091
|
|
26
|
+
# shellcheck source=agent-erreurs.sh disable=SC1091
|
|
28
27
|
. "$ICI/agent-erreurs.sh"
|
|
29
28
|
# Fichiers de droits des agents protégés (#361)
|
|
30
|
-
# shellcheck source=agent-droits.sh
|
|
31
|
-
# shellcheck disable=SC1091
|
|
29
|
+
# shellcheck source=agent-droits.sh disable=SC1091
|
|
32
30
|
. "$ICI/agent-droits.sh"
|
|
33
31
|
# Configuration, rang partagé, journal et état (#328)
|
|
34
|
-
# shellcheck source=agent-session.sh
|
|
35
|
-
# shellcheck disable=SC1091
|
|
32
|
+
# shellcheck source=agent-session.sh disable=SC1091
|
|
36
33
|
. "$ICI/agent-session.sh"
|
|
37
34
|
# Workspace Kubernetes : projet et journal dans le pod (#431)
|
|
38
|
-
# shellcheck source=agent-workspace.sh
|
|
39
|
-
# shellcheck disable=SC1091
|
|
35
|
+
# shellcheck source=agent-workspace.sh disable=SC1091
|
|
40
36
|
. "$ICI/agent-workspace.sh"
|
|
37
|
+
# Modèle local en dernier de la rotation (#586)
|
|
38
|
+
# shellcheck source=agent-local.sh disable=SC1091
|
|
39
|
+
. "$ICI/agent-local.sh"
|
|
41
40
|
# Liste de secours si « opencode models opencode » ne répond pas : même ordre
|
|
42
41
|
# que la configuration opencode livrée par devzone.
|
|
43
42
|
FREE_MODELS=(big-pickle deepseek-v4.1-flash-free glm-5.3-flash-free nemotron-3.5-super-vl-free
|
|
@@ -78,6 +77,7 @@ agent_lancer() {
|
|
|
78
77
|
if [ -n "$m" ]; then FREE_MODELS+=("$m"); fi
|
|
79
78
|
done < <(liste_modeles)
|
|
80
79
|
[ "${#FREE_MODELS[@]}" -gt 0 ] || refuse "aucun modèle gratuit disponible"
|
|
80
|
+
local_charge
|
|
81
81
|
verrou_prendre || refuse "rang des modèles verrouillé : réessayer"
|
|
82
82
|
debut=$(( $(cat "$etat/rang" 2>/dev/null || echo 0) % ${#FREE_MODELS[@]} ))
|
|
83
83
|
if [ "$PAUSE_RANG" -gt 0 ]; then sleep "$PAUSE_RANG"; fi
|
|
@@ -97,8 +97,8 @@ agent_lancer() {
|
|
|
97
97
|
consigne_courante="$c"
|
|
98
98
|
}
|
|
99
99
|
i=0
|
|
100
|
-
while [ "$i" -lt "$
|
|
101
|
-
m="$
|
|
100
|
+
while [ "$i" -lt "$(modeles_total)" ]; do
|
|
101
|
+
m="$(modele_au_rang "$i" "$debut")"
|
|
102
102
|
if [ "$m" != "$reseau_pour" ]; then reseau_pour="$m"; reseau_n=0; fi
|
|
103
103
|
if modele_ecarte "$m"; then
|
|
104
104
|
i=$(( i + 1 ))
|
|
@@ -44,6 +44,10 @@ argocd_revision() {
|
|
|
44
44
|
# container (limited devzone context)
|
|
45
45
|
catalogue_argocd_load() {
|
|
46
46
|
[ -n "$CATALOGUE_ARGOCD_WIRED" ] && return 0
|
|
47
|
+
# The Applications are applied with the devzone context, the only one the
|
|
48
|
+
# container holds (services.sh and gitops.sh call argocd_kubectl)
|
|
49
|
+
# shellcheck disable=SC2317 # called by services.sh and gitops.sh
|
|
50
|
+
argocd_kubectl() { kubectl --context devzone "$@"; }
|
|
47
51
|
# shellcheck disable=SC2034 # read by apps.sh
|
|
48
52
|
APPS_CMD="devzone argocd app"
|
|
49
53
|
# shellcheck disable=SC2034 # read by apps.sh and services.sh
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# GitLab as the GitOps repository of Argo CD (#559, step 6): devzone/devzone-argocd
|
|
3
|
+
# on the devzone GitLab, written through its API (files endpoint, no clone). The
|
|
4
|
+
# repository is designated with provider = gitlab in [argocd] of .argocd.conf;
|
|
5
|
+
# the repository URL is the internal one (Argo CD reads it in the cluster).
|
|
6
|
+
# The root token is read from workspace/.gitlab/root-token, sent through a curl
|
|
7
|
+
# config file (never on the command line) and never printed.
|
|
8
|
+
# Sourced by gitops.sh, which dispatches its put, sha, delete and root functions
|
|
9
|
+
# here when gitops_is_gitlab holds. The includer defines RACINE, conf_set and
|
|
10
|
+
# conf_get (conf.sh). GITLAB_GITOPS_API: base URL of the API seen by this
|
|
11
|
+
# process (the relay of the container by default). bash 3.2 (macOS).
|
|
12
|
+
# gitlab_gitops_init project created by the API, repository designated
|
|
13
|
+
# gitlab_gitops_sha <path> blob id of a file, empty when absent
|
|
14
|
+
# gitlab_gitops_put <path> <file> <message> create or update, same blob skipped
|
|
15
|
+
# gitlab_gitops_delete <path> <message> file removed
|
|
16
|
+
# gitlab_gitops_root_token the token of the Argo CD repository Secret
|
|
17
|
+
|
|
18
|
+
GITLAB_GITOPS_GROUP="${GITLAB_GITOPS_GROUP:-devzone}"
|
|
19
|
+
GITLAB_GITOPS_PROJECT="${GITLAB_GITOPS_PROJECT:-devzone-argocd}"
|
|
20
|
+
GITLAB_GITOPS_BRANCH="${GITLAB_GITOPS_BRANCH:-main}"
|
|
21
|
+
GITLAB_GITOPS_API="${GITLAB_GITOPS_API:-http://gitlab.localhost:8929}"
|
|
22
|
+
# Internal URL of the repository for Argo CD (the webservice of devzone-gitlab)
|
|
23
|
+
GITLAB_GITOPS_URL_INTERNE="${GITLAB_GITOPS_URL_INTERNE:-http://gitlab-webservice-default.devzone-gitlab.svc:8181/$GITLAB_GITOPS_GROUP/$GITLAB_GITOPS_PROJECT.git}"
|
|
24
|
+
|
|
25
|
+
# Root token of the devzone GitLab; refused when absent (devzone enable gitlab)
|
|
26
|
+
gitlab_gitops_root_token() {
|
|
27
|
+
local file="$RACINE/workspace/.gitlab/root-token" token=""
|
|
28
|
+
[ -s "$file" ] && token="$(cat "$file")"
|
|
29
|
+
if [ -z "$token" ]; then
|
|
30
|
+
echo "✖ GitLab root token missing ($file): devzone enable gitlab" >&2
|
|
31
|
+
return 1
|
|
32
|
+
fi
|
|
33
|
+
printf '%s' "$token"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# One API call: METHOD PATH [curl options]; the token goes through a config file
|
|
37
|
+
# (mode 600, removed right after), so it never shows in the process list
|
|
38
|
+
gitlab_gitops_api() {
|
|
39
|
+
local method="$1" path="$2" cfg token rc=0
|
|
40
|
+
shift 2
|
|
41
|
+
token="$(gitlab_gitops_root_token)" || return 1
|
|
42
|
+
cfg="$(mktemp)"
|
|
43
|
+
chmod 600 "$cfg"
|
|
44
|
+
printf 'header = "PRIVATE-TOKEN: %s"\n' "$token" >"$cfg" || { rm -f "$cfg"; return 1; }
|
|
45
|
+
curl -s --config "$cfg" --request "$method" "$GITLAB_GITOPS_API/api/v4$path" "$@" || rc=$?
|
|
46
|
+
rm -f "$cfg"
|
|
47
|
+
return "$rc"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# The project path, URL-encoded for the API (devzone%2Fdevzone-argocd)
|
|
51
|
+
gitlab_gitops_projet() {
|
|
52
|
+
printf '%s' "$GITLAB_GITOPS_GROUP%2F$GITLAB_GITOPS_PROJECT"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# Numeric id of the project, empty when it does not exist
|
|
56
|
+
gitlab_gitops_id() {
|
|
57
|
+
gitlab_gitops_api GET "/projects/$(gitlab_gitops_projet)" 2>/dev/null | jq -r '.id // empty' 2>/dev/null || true
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# A file path URL-encoded for the files endpoint (apps/x.yaml -> apps%2Fx.yaml)
|
|
61
|
+
gitlab_gitops_chemin() {
|
|
62
|
+
printf '%s' "$1" | jq -sRr '@uri'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Blob id of a file on the branch (the files endpoint), empty when absent
|
|
66
|
+
gitlab_gitops_sha() {
|
|
67
|
+
local id
|
|
68
|
+
id="$(gitlab_gitops_id)"
|
|
69
|
+
[ -n "$id" ] || return 0
|
|
70
|
+
gitlab_gitops_api GET "/projects/$id/repository/files/$(gitlab_gitops_chemin "$1")?ref=$GITLAB_GITOPS_BRANCH" 2>/dev/null |
|
|
71
|
+
jq -r '.blob_id // empty' 2>/dev/null || true
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Creates or updates a file: PUT when the file exists, POST when it is new
|
|
75
|
+
gitlab_gitops_put() {
|
|
76
|
+
local path="$1" file="$2" message="$3" id sha content verb
|
|
77
|
+
id="$(gitlab_gitops_id)"
|
|
78
|
+
[ -n "$id" ] || { echo "✖ GitLab project $GITLAB_GITOPS_GROUP/$GITLAB_GITOPS_PROJECT missing: devzone argocd init --gitlab" >&2; return 1; }
|
|
79
|
+
sha="$(gitlab_gitops_sha "$path")"
|
|
80
|
+
if [ -n "$sha" ] && [ "$sha" = "$(git hash-object "$file" 2>/dev/null || true)" ]; then
|
|
81
|
+
return 0
|
|
82
|
+
fi
|
|
83
|
+
content="$(base64 <"$file" | tr -d '\n')"
|
|
84
|
+
verb=POST
|
|
85
|
+
[ -z "$sha" ] || verb=PUT
|
|
86
|
+
gitlab_gitops_api "$verb" "/projects/$id/repository/files/$(gitlab_gitops_chemin "$path")" \
|
|
87
|
+
--data-urlencode "branch=$GITLAB_GITOPS_BRANCH" \
|
|
88
|
+
--data-urlencode "encoding=base64" \
|
|
89
|
+
--data-urlencode "content=$content" \
|
|
90
|
+
--data-urlencode "commit_message=$message" >/dev/null
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# Removes a file on the branch; nothing to do when it is absent
|
|
94
|
+
gitlab_gitops_delete() {
|
|
95
|
+
local path="$1" message="$2" id
|
|
96
|
+
id="$(gitlab_gitops_id)"
|
|
97
|
+
[ -n "$id" ] || return 0
|
|
98
|
+
[ -n "$(gitlab_gitops_sha "$path")" ] || return 0
|
|
99
|
+
gitlab_gitops_api DELETE "/projects/$id/repository/files/$(gitlab_gitops_chemin "$path")" \
|
|
100
|
+
--data-urlencode "branch=$GITLAB_GITOPS_BRANCH" \
|
|
101
|
+
--data-urlencode "commit_message=$message" >/dev/null
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
# The group devzone (created by the seed when missing), then the project
|
|
105
|
+
# devzone/devzone-argocd with a first commit (README) so that the files can be
|
|
106
|
+
# written; the repository is designated in [argocd] (internal URL, provider)
|
|
107
|
+
gitlab_gitops_init() {
|
|
108
|
+
local group id
|
|
109
|
+
gitlab_gitops_root_token >/dev/null || return 1
|
|
110
|
+
group="$(gitlab_gitops_api GET "/groups/$GITLAB_GITOPS_GROUP" 2>/dev/null | jq -r '.id // empty' 2>/dev/null || true)"
|
|
111
|
+
if [ -z "$group" ]; then
|
|
112
|
+
group="$(gitlab_gitops_api POST /groups --data-urlencode "name=$GITLAB_GITOPS_GROUP" \
|
|
113
|
+
--data-urlencode "path=$GITLAB_GITOPS_GROUP" --data "visibility=private" 2>/dev/null | jq -r '.id // empty' 2>/dev/null || true)"
|
|
114
|
+
fi
|
|
115
|
+
[ -n "$group" ] || { echo "✖ GitLab group $GITLAB_GITOPS_GROUP not created" >&2; return 1; }
|
|
116
|
+
id="$(gitlab_gitops_id)"
|
|
117
|
+
if [ -z "$id" ]; then
|
|
118
|
+
id="$(gitlab_gitops_api POST /projects --data-urlencode "name=$GITLAB_GITOPS_PROJECT" \
|
|
119
|
+
--data "namespace_id=$group" --data "visibility=private" --data "initialize_with_readme=true" \
|
|
120
|
+
--data-urlencode "default_branch=$GITLAB_GITOPS_BRANCH" 2>/dev/null | jq -r '.id // empty' 2>/dev/null || true)"
|
|
121
|
+
[ -n "$id" ] || { echo "✖ GitLab project $GITLAB_GITOPS_GROUP/$GITLAB_GITOPS_PROJECT not created" >&2; return 1; }
|
|
122
|
+
echo "✔ GitOps repository created on GitLab: $GITLAB_GITOPS_GROUP/$GITLAB_GITOPS_PROJECT (private)"
|
|
123
|
+
gitops_put_text apps/.gitkeep "" "devzone: apps folder"
|
|
124
|
+
fi
|
|
125
|
+
conf_set argocd "repo=$GITLAB_GITOPS_URL_INTERNE" "provider=gitlab"
|
|
126
|
+
echo "✔ GitOps repository: GitLab $GITLAB_GITOPS_GROUP/$GITLAB_GITOPS_PROJECT (internal URL in Argo CD)"
|
|
127
|
+
}
|
|
@@ -23,9 +23,14 @@ GITOPS_NS="devzone-argocd"
|
|
|
23
23
|
GITOPS_ROOT_APP="devzone"
|
|
24
24
|
GITOPS_REPO_NAME="${DEVZONE_GITOPS_REPO_NAME:-devzone-argocd}"
|
|
25
25
|
: "${GITOPS_CMD:=devzone argocd init}"
|
|
26
|
+
# shellcheck source=SCRIPTDIR/gitops-gitlab.sh
|
|
27
|
+
# shellcheck disable=SC1091
|
|
28
|
+
. "$(dirname "${BASH_SOURCE[0]}")/gitops-gitlab.sh"
|
|
26
29
|
|
|
27
30
|
gitops_repo() { conf_get argocd repo; }
|
|
28
31
|
gitops_repo_note() { conf_set argocd "repo=$1"; }
|
|
32
|
+
# GitLab designated (provider = gitlab, #559): the files go through its API
|
|
33
|
+
gitops_is_gitlab() { [ "$(conf_get argocd provider)" = gitlab ]; }
|
|
29
34
|
|
|
30
35
|
gitops_enabled() {
|
|
31
36
|
local r
|
|
@@ -49,6 +54,7 @@ gitops_init() {
|
|
|
49
54
|
for arg in "$@"; do
|
|
50
55
|
if [ "$expect" = repo ]; then repo="$arg"; expect=""; continue; fi
|
|
51
56
|
case "$arg" in
|
|
57
|
+
--gitlab) gitlab_gitops_init; return ;;
|
|
52
58
|
--none)
|
|
53
59
|
gitops_repo_note none
|
|
54
60
|
echo "✔ no GitOps repository: the Applications are applied directly ($GITOPS_CMD to change)"
|
|
@@ -121,12 +127,14 @@ GitOps repository of devzone, written by the devzone commands (never by hand): t
|
|
|
121
127
|
gitops_blob() { git hash-object "$1" 2>/dev/null || true; }
|
|
122
128
|
|
|
123
129
|
gitops_sha() {
|
|
130
|
+
if gitops_is_gitlab; then gitlab_gitops_sha "$@"; return; fi
|
|
124
131
|
gh api "repos/$(gitops_slug)/contents/$1" --jq .sha 2>/dev/null || true
|
|
125
132
|
}
|
|
126
133
|
|
|
127
134
|
# Writes <file> at <path> of the repository (create or update), <message>
|
|
128
135
|
gitops_put() {
|
|
129
136
|
local path="$1" file="$2" message="$3" slug sha content
|
|
137
|
+
if gitops_is_gitlab; then gitlab_gitops_put "$@"; return; fi
|
|
130
138
|
slug="$(gitops_slug)"
|
|
131
139
|
sha="$(gitops_sha "$path")"
|
|
132
140
|
if [ -n "$sha" ] && [ "$sha" = "$(gitops_blob "$file")" ]; then
|
|
@@ -150,6 +158,7 @@ gitops_put_text() {
|
|
|
150
158
|
|
|
151
159
|
gitops_delete() {
|
|
152
160
|
local path="$1" message="$2" sha
|
|
161
|
+
if gitops_is_gitlab; then gitlab_gitops_delete "$@"; return; fi
|
|
153
162
|
sha="$(gitops_sha "$path")"
|
|
154
163
|
[ -n "$sha" ] || return 0
|
|
155
164
|
gh api -X DELETE "repos/$(gitops_slug)/contents/$path" -f message="$message" -f sha="$sha" >/dev/null
|
|
@@ -157,10 +166,11 @@ gitops_delete() {
|
|
|
157
166
|
|
|
158
167
|
# Repository Secret (token of gh) and root Application "devzone" on apps/
|
|
159
168
|
gitops_root() {
|
|
160
|
-
local url token
|
|
169
|
+
local url token user=devzone
|
|
161
170
|
gitops_enabled || return 0
|
|
162
171
|
url="$(gitops_repo)"
|
|
163
172
|
token="${DEVZONE_GITOPS_TOKEN:-$(gh auth token 2>/dev/null || true)}"
|
|
173
|
+
if gitops_is_gitlab; then user=oauth2; token="$(gitlab_gitops_root_token 2>/dev/null || true)"; fi
|
|
164
174
|
if [ -n "$token" ]; then
|
|
165
175
|
argocd_kubectl -n "$GITOPS_NS" apply -f - >/dev/null <<EOF
|
|
166
176
|
apiVersion: v1
|
|
@@ -175,7 +185,7 @@ type: Opaque
|
|
|
175
185
|
stringData:
|
|
176
186
|
type: git
|
|
177
187
|
url: $url
|
|
178
|
-
username:
|
|
188
|
+
username: $user
|
|
179
189
|
password: $token
|
|
180
190
|
EOF
|
|
181
191
|
else
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Services of the container held by Argo CD (#559, step 5). Called by devzone
|
|
3
|
+
# (changer) after the state line is written, before the helm-direct path:
|
|
4
|
+
# services-hook.sh <svc> <on|off>
|
|
5
|
+
# postgres, mysql and llm with the module argocd installed and held: enable writes
|
|
6
|
+
# [services] <svc> = on and reconciles it (services_reconcile, services.sh),
|
|
7
|
+
# then waits for the pods and starts the relay; disable removes the
|
|
8
|
+
# Application (its resources leave with it, namespace and volumes stay).
|
|
9
|
+
# argocd off: the Applications of postgres, mysql and gitlab leave with their
|
|
10
|
+
# finalizer dropped first, so the resources stay for the helm-direct path
|
|
11
|
+
# (adoption, no recreation); then devzone removes Argo CD.
|
|
12
|
+
# Exit codes read by devzone: 0 done through Argo CD (devzone stops there),
|
|
13
|
+
# 3 not concerned or released (devzone goes on as before), 1 failed.
|
|
14
|
+
# gitlab is not held here: its Application comes from gitlab/argocd.sh (step 4).
|
|
15
|
+
# Sourced by the tests with stubs; run as a script by devzone. bash 3.2.
|
|
16
|
+
|
|
17
|
+
ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
+
# RACINE: the code tree (libraries, charts); STATE_RACINE: the devzone folder
|
|
19
|
+
# (workspace/ secrets, .argocd.conf), the same folder unless DEVZONE_RACINE says so
|
|
20
|
+
RACINE="$(dirname "$(dirname "$ICI")")"
|
|
21
|
+
STATE_RACINE="${DEVZONE_RACINE:-$RACINE}"
|
|
22
|
+
# shellcheck disable=SC2034 # read by catalogue-argocd.sh
|
|
23
|
+
ETAT="${DEVZONE_ETAT:-$STATE_RACINE/.devzone.modules}"
|
|
24
|
+
APP_CONF="$RACINE/.devcontainer/catalogue/mysql/app.conf"
|
|
25
|
+
HOOK_SERVICES="postgres mysql llm"
|
|
26
|
+
|
|
27
|
+
# shellcheck source=SCRIPTDIR/../cluster.sh
|
|
28
|
+
# shellcheck disable=SC1091
|
|
29
|
+
. "$ICI/../cluster.sh"
|
|
30
|
+
# shellcheck source=SCRIPTDIR/catalogue-argocd.sh
|
|
31
|
+
# shellcheck disable=SC1091
|
|
32
|
+
. "$ICI/catalogue-argocd.sh"
|
|
33
|
+
|
|
34
|
+
# Loads the Argo CD pieces (conf, gitops, services with the context devzone)
|
|
35
|
+
# and the list of services reconciled here
|
|
36
|
+
hook_load() {
|
|
37
|
+
DEVZONE_ARGOCD_CONF="${DEVZONE_ARGOCD_CONF:-$STATE_RACINE/.argocd.conf}"
|
|
38
|
+
export DEVZONE_ARGOCD_CONF
|
|
39
|
+
catalogue_argocd_load
|
|
40
|
+
# shellcheck disable=SC2034 # read by services.sh (services_reconcile)
|
|
41
|
+
SERVICES_LIST="$HOOK_SERVICES"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# The relay script of a service (started once its pods are ready)
|
|
45
|
+
hook_script() {
|
|
46
|
+
case "$1" in
|
|
47
|
+
postgres) printf '%s' "$ICI/../postgres/postgres.sh" ;;
|
|
48
|
+
mysql) printf '%s' "$ICI/../catalogue/mysql/mysql.sh" ;;
|
|
49
|
+
llm) printf '%s' "$ICI/../llm/llm.sh" ;;
|
|
50
|
+
esac
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# Waits for the pods of devzone-<svc> to be ready (the Application syncs
|
|
54
|
+
# within a few minutes); the relay needs a ready pod to forward to. The model
|
|
55
|
+
# of llm is downloaded on its first start: LLM_ATTENTE seconds (1800)
|
|
56
|
+
hook_wait() {
|
|
57
|
+
local ns="devzone-$1" tour=0 limit=300
|
|
58
|
+
[ "$1" != llm ] || limit="${LLM_ATTENTE:-1800}"
|
|
59
|
+
while [ "$tour" -lt 60 ]; do
|
|
60
|
+
if argocd_kubectl -n "$ns" get pods -o name 2>/dev/null | grep -q .; then
|
|
61
|
+
argocd_kubectl -n "$ns" wait --for=condition=Ready pod --all --timeout="${limit}s" >/dev/null 2>&1 && return 0
|
|
62
|
+
fi
|
|
63
|
+
tour=$((tour + 1))
|
|
64
|
+
sleep 5
|
|
65
|
+
done
|
|
66
|
+
echo "✖ $1 : pods not ready in devzone-$1 (devzone argocd status)" >&2
|
|
67
|
+
return 1
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# The llm.sh subcommands used by enable (preset, policy); a function so the
|
|
71
|
+
# tests replace it
|
|
72
|
+
hook_llm() {
|
|
73
|
+
DEVZONE_RACINE="$STATE_RACINE" bash "$ICI/../llm/llm.sh" "$@"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Starts the relay of the service, after the pods are ready
|
|
77
|
+
hook_relay() {
|
|
78
|
+
bash "$(hook_script "$1")" relay-start
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# Admin secret <svc>-admin of the namespace, created apart and mirrored in
|
|
82
|
+
# workspace/.<svc>/admin-password (600); an existing secret is kept, never
|
|
83
|
+
# printed. The same mirror the helm-direct installers read.
|
|
84
|
+
services_secret_admin() {
|
|
85
|
+
local svc="$1" ns="$2" secret="$3" dir file password=""
|
|
86
|
+
dir="$STATE_RACINE/workspace/.$svc"
|
|
87
|
+
file="$dir/admin-password"
|
|
88
|
+
mkdir -p "$dir"
|
|
89
|
+
chmod 700 "$dir"
|
|
90
|
+
password="$(argocd_kubectl -n "$ns" get secret "$secret" -o jsonpath='{.data.password}' 2>/dev/null | base64 -d 2>/dev/null)" || password=""
|
|
91
|
+
if [ -n "$password" ]; then
|
|
92
|
+
(umask 077 && printf '%s' "$password" >"$file")
|
|
93
|
+
else
|
|
94
|
+
if [ ! -s "$file" ]; then
|
|
95
|
+
(umask 077 && openssl rand -hex 24 | tr -d '\n' >"$file")
|
|
96
|
+
fi
|
|
97
|
+
argocd_kubectl -n "$ns" create secret generic "$secret" --from-file=password="$file" >/dev/null
|
|
98
|
+
fi
|
|
99
|
+
chmod 600 "$file"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Secret hooks of services_reconcile: the superuser secret of each service
|
|
103
|
+
services_secret_postgres() { services_secret_admin postgres devzone-postgres postgres-admin; }
|
|
104
|
+
# The superuser secret of MySQL, the same way
|
|
105
|
+
services_secret_mysql() { services_secret_admin mysql devzone-mysql mysql-admin; }
|
|
106
|
+
|
|
107
|
+
# The llm secret hook: the chart has no Secret, nothing to create
|
|
108
|
+
services_secret_llm() { :; }
|
|
109
|
+
|
|
110
|
+
# Parameters of the llm chart: the stored preset (devzone enable llm --preset
|
|
111
|
+
# light), the model and the memory it needs
|
|
112
|
+
services_chart_llm() {
|
|
113
|
+
local preset
|
|
114
|
+
# shellcheck source=SCRIPTDIR/../llm/presets.sh
|
|
115
|
+
# shellcheck disable=SC1091
|
|
116
|
+
. "$ICI/../llm/presets.sh"
|
|
117
|
+
preset="$(cat "$STATE_RACINE/workspace/.llm/preset" 2>/dev/null || true)"
|
|
118
|
+
llm_preset_sets "$preset"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Value of a key of the MySQL application file (app.conf, read as text)
|
|
122
|
+
app_value() { sed -n "s/^$1=//p" "$APP_CONF" 2>/dev/null | tail -1; }
|
|
123
|
+
|
|
124
|
+
# Parameters of the MySQL chart: image, port, memory and size of app.conf, and
|
|
125
|
+
# the claim of the one existing volume (*-mysql-0); several volumes: refused,
|
|
126
|
+
# as the helm-direct installer does (#440)
|
|
127
|
+
services_chart_mysql() {
|
|
128
|
+
local liste claim="" image port memoire taille
|
|
129
|
+
image="$(app_value image)"
|
|
130
|
+
port="$(app_value port)"
|
|
131
|
+
memoire="$(app_value memoire)"
|
|
132
|
+
taille="$(app_value taille)"
|
|
133
|
+
liste="$(argocd_kubectl -n devzone-mysql get pvc -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' 2>/dev/null | grep -E '\-mysql-0$' || true)"
|
|
134
|
+
if [ -n "$liste" ]; then
|
|
135
|
+
if [ "$(printf '%s\n' "$liste" | grep -c .)" -gt 1 ]; then
|
|
136
|
+
echo "✖ several MySQL volumes in devzone-mysql: devzone mysql volume <name> picks the mounted one" >&2
|
|
137
|
+
return 2
|
|
138
|
+
fi
|
|
139
|
+
claim=" claim=${liste%-mysql-0}"
|
|
140
|
+
fi
|
|
141
|
+
printf 'image=%s port=%s memory=%s size=%s%s' "${image:-mysql:8.4}" "${port:-3306}" \
|
|
142
|
+
"${memoire:-1Gi}" "${taille:-5Gi}" "$claim"
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
# Enable: through Argo CD only when the module is held (installed, chart and
|
|
146
|
+
# revision known); otherwise 3, the helm-direct installer runs as before
|
|
147
|
+
hook_on() {
|
|
148
|
+
local svc="$1"
|
|
149
|
+
catalogue_argocd_active "$svc" || return 3
|
|
150
|
+
# llm: the preset of the command line, then the ingress of the workspace
|
|
151
|
+
if [ "$svc" = llm ]; then
|
|
152
|
+
hook_llm preset "${@:2}" || return 1
|
|
153
|
+
fi
|
|
154
|
+
services_note "$svc" on || return 1
|
|
155
|
+
services_reconcile || return 1
|
|
156
|
+
echo "▶ $svc as an Argo CD Application (charts/devzone-$svc at $(argocd_revision))…"
|
|
157
|
+
if [ "$svc" = llm ]; then
|
|
158
|
+
hook_llm policy || return 1
|
|
159
|
+
fi
|
|
160
|
+
hook_wait "$svc" || return 1
|
|
161
|
+
hook_relay "$svc" || return 1
|
|
162
|
+
echo "✔ $svc held by Argo CD ([services] $svc = on in .argocd.conf)"
|
|
163
|
+
return 0
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
# Disable: the Application leaves with its resources (cascade); 3 so that the
|
|
167
|
+
# usual uninstall of the service goes on and keeps its data rules
|
|
168
|
+
hook_off() {
|
|
169
|
+
local svc="$1"
|
|
170
|
+
catalogue_argocd_application_exists "$svc" || return 3
|
|
171
|
+
services_note "$svc" off || return 1
|
|
172
|
+
gitops_delete_application "devzone-$svc" || return 1
|
|
173
|
+
echo "✔ Application devzone-$svc removed (its resources leave with it)"
|
|
174
|
+
return 3
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# argocd off: each Application of the services leaves with its finalizer
|
|
178
|
+
# dropped first (gitops_delete_application keep): the resources stay for the
|
|
179
|
+
# helm-direct path. The module is already off when this runs, so the check
|
|
180
|
+
# is on the Application itself, not on the module state.
|
|
181
|
+
hook_release() {
|
|
182
|
+
local svc app
|
|
183
|
+
for svc in postgres mysql gitlab llm; do
|
|
184
|
+
app="devzone-$svc"
|
|
185
|
+
argocd_kubectl -n devzone-argocd get application.argoproj.io "$app" >/dev/null 2>&1 || continue
|
|
186
|
+
argocd_kubectl -n devzone-argocd patch application.argoproj.io "$app" --type merge \
|
|
187
|
+
-p '{"metadata":{"finalizers":null}}' >/dev/null 2>&1 || true
|
|
188
|
+
gitops_delete_application "$app" keep || return 1
|
|
189
|
+
case "$svc" in
|
|
190
|
+
postgres | mysql | llm) services_note "$svc" off || return 1 ;;
|
|
191
|
+
esac
|
|
192
|
+
echo "✔ Application $app released: its resources stay for the helm-direct path"
|
|
193
|
+
done
|
|
194
|
+
return 3
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
# Dispatch: the pair service and action decides; anything else is not concerned
|
|
198
|
+
hook_main() {
|
|
199
|
+
local svc="${1:-}" action="${2:-}"
|
|
200
|
+
case "$svc:$action" in
|
|
201
|
+
argocd:off) hook_load && hook_release ;;
|
|
202
|
+
postgres:on | mysql:on | llm:on) hook_load && hook_on "$svc" "${@:3}" ;;
|
|
203
|
+
postgres:off | mysql:off | llm:off) hook_load && hook_off "$svc" ;;
|
|
204
|
+
*) return 3 ;;
|
|
205
|
+
esac
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
|
209
|
+
hook_main "$@"
|
|
210
|
+
exit $?
|
|
211
|
+
fi
|
|
@@ -9,6 +9,9 @@ ATTENTE="${DEVZONE_CATALOGUE_ATTENTE:-300}"
|
|
|
9
9
|
# shellcheck source=SCRIPTDIR/argocd/catalogue-argocd.sh
|
|
10
10
|
# shellcheck disable=SC1091
|
|
11
11
|
. "$ICI/argocd/catalogue-argocd.sh"
|
|
12
|
+
# shellcheck source=SCRIPTDIR/chart-direct.sh
|
|
13
|
+
# shellcheck disable=SC1091
|
|
14
|
+
. "$ICI/chart-direct.sh"
|
|
12
15
|
|
|
13
16
|
# Attente du StatefulSet prêt : une seule commande rollout sur la voie
|
|
14
17
|
# manifeste, sondée sur la voie Argo CD (la synchronisation est en tâche de
|
|
@@ -66,7 +69,7 @@ regenerer_identifiants() {
|
|
|
66
69
|
# #538) ou manifeste, attente prête, relais lancé vers 127.0.0.1:<port> du
|
|
67
70
|
# conteneur ; rend non nul en échec
|
|
68
71
|
app_installer() {
|
|
69
|
-
local app="$1" ns port image CTX
|
|
72
|
+
local app="$1" ns port image CTX extra="" argo=0
|
|
70
73
|
ns="$(app_ns "$app")"
|
|
71
74
|
port="$(app_lire "$app" port)"
|
|
72
75
|
image="$(app_lire "$app" image)"
|
|
@@ -99,13 +102,9 @@ app_installer() {
|
|
|
99
102
|
catalogue_argocd_apply "$app" "$ns" "$image" "$port" \
|
|
100
103
|
"$(app_lire "$app" memoire)" "$(app_lire "$app" taille)" "$extra" || return 1
|
|
101
104
|
else
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-e "s|__TAILLE__|$(app_lire "$app" taille)|g" -e "s|__CLAIM__|$claim|g" \
|
|
106
|
-
"$(dossier_catalogue)/$app/manifeste.yaml" >"$man" &&
|
|
107
|
-
kubectl --context devzone -n "$ns" apply -f "$man" >/dev/null
|
|
108
|
-
rm -f "$man"
|
|
105
|
+
# Helm direct: the chart charts/devzone-<app>, the one definition (#559)
|
|
106
|
+
chart_install "$app" "$ns" "image=$image" "port=$port" \
|
|
107
|
+
"memory=$(app_lire "$app" memoire)" "size=$(app_lire "$app" taille)" "claim=$claim" || return 1
|
|
109
108
|
fi
|
|
110
109
|
app_attendre "$app" "$ns" "$argo" || return 1
|
|
111
110
|
relais_lancer "$app" "$CTX" "$ns" "svc/$app" "$port:$port"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Installation MySQL (#440) : secret,
|
|
2
|
+
# Installation MySQL (#440) : secret, chart et réinstallation sur un volume.
|
|
3
|
+
# shellcheck source=SCRIPTDIR/../../chart-direct.sh
|
|
4
|
+
# shellcheck disable=SC1091
|
|
5
|
+
. "$ICI/../../chart-direct.sh"
|
|
3
6
|
|
|
4
7
|
# Secret admin (mysql-admin) : root.env ou secret existant, jamais régénéré.
|
|
5
8
|
mysql_secret() {
|
|
@@ -52,13 +55,11 @@ mysql_installer_argocd() {
|
|
|
52
55
|
regenerer_identifiants
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
#
|
|
56
|
-
|
|
58
|
+
# Installe le chart charts/devzone-mysql avec le claim choisi (#440, #559)
|
|
59
|
+
mysql_appliquer_chart() {
|
|
57
60
|
local ns="$1" claim="$2"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-e "s|__TAILLE__|$MYSQL_TAILLE|g" -e "s|__CLAIM__|$claim|g" \
|
|
61
|
-
"$ICI/manifeste.yaml" | kubectl --context devzone -n "$ns" apply -f - >/dev/null
|
|
61
|
+
chart_install mysql "$ns" "image=$MYSQL_IMAGE" "port=$MYSQL_PORT" \
|
|
62
|
+
"memory=$MYSQL_MEMOIRE" "size=$MYSQL_TAILLE" "claim=$claim"
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
# (Ré)installe MySQL sur le claim demandé, données du PVC gardées (#440)
|
|
@@ -74,7 +75,7 @@ mysql_installer_claim() {
|
|
|
74
75
|
namespace_isoler "$ns" >/dev/null
|
|
75
76
|
mysql_secret
|
|
76
77
|
k delete statefulset mysql --ignore-not-found >/dev/null 2>&1 || true
|
|
77
|
-
|
|
78
|
+
mysql_appliquer_chart "$ns" "$claim" || return 1
|
|
78
79
|
if ! k rollout status statefulset/mysql --timeout="${MYSQL_ATTENTE}s" >/dev/null; then
|
|
79
80
|
echo "devzone : catalogue mysql : pas prêt après ${MYSQL_ATTENTE}s : kubectl --context $CTX -n $ns describe pod mysql-0" >&2
|
|
80
81
|
return 1
|
|
@@ -111,7 +111,7 @@ installer() {
|
|
|
111
111
|
else
|
|
112
112
|
mysql_secret
|
|
113
113
|
claim="$(mysql_claim_choisir "$NS")" || return 2
|
|
114
|
-
|
|
114
|
+
mysql_appliquer_chart "$NS" "$claim" || return 1
|
|
115
115
|
if ! k rollout status statefulset/mysql --timeout="${MYSQL_ATTENTE}s" >/dev/null; then
|
|
116
116
|
echo "devzone : catalogue mysql : pas prêt après ${MYSQL_ATTENTE}s : kubectl --context $CTX -n $NS describe pod mysql-0" >&2
|
|
117
117
|
return 1
|
|
@@ -144,7 +144,7 @@ supprimer_donnees() {
|
|
|
144
144
|
CTX="$(cluster_lu)"
|
|
145
145
|
[ -n "$CTX" ] || refuse "aucun cluster choisi : devzone enable mysql"
|
|
146
146
|
installe || refuse "module inactif : devzone enable mysql"
|
|
147
|
-
echo "▶ Suppression de MySQL et de ses volumes sur $CTX…"
|
|
147
|
+
echo "▶ Suppression de MySQL et de ses volumes sur ${CTX}…"
|
|
148
148
|
# L'Application part d'abord (#538) : sinon Argo CD recrée le namespace
|
|
149
149
|
catalogue_argocd_delete mysql >/dev/null 2>&1 || true
|
|
150
150
|
# RoleBinding retiré puis namespace supprimé par l'administrateur (#430)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Catalogue d'applications (#414) : une application préconfigurée par dossier
|
|
3
|
-
# .devcontainer/catalogue/<app>/ (app.conf
|
|
3
|
+
# .devcontainer/catalogue/<app>/ (app.conf ; le chart charts/devzone-<app>, #559), installée dans le
|
|
4
4
|
# cluster des services de devzone sous son namespace de app.conf ; l'état
|
|
5
5
|
# voulu est la ligne <app>=on|off de .devzone.modules.
|
|
6
6
|
# catalogue.sh sync | apply | list | resume | json | remove <app>
|