devzone 0.42.0 → 0.43.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.sh +1 -1
- package/.devcontainer/argocd/apps.sh +2 -2
- package/.devcontainer/argocd/argocd.sh +22 -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 +181 -0
- package/.devcontainer/catalogue/app.sh +29 -12
- package/.devcontainer/catalogue/catalogue-veilleur.sh +2 -2
- package/.devcontainer/catalogue/mysql/installer.sh +9 -8
- package/.devcontainer/catalogue/mysql/mysql.sh +42 -29
- package/.devcontainer/catalogue/mysql/volume.sh +5 -5
- package/.devcontainer/catalogue.sh +30 -36
- package/.devcontainer/chart-direct.sh +49 -0
- package/.devcontainer/cluster.sh +11 -11
- package/.devcontainer/clusters.sh +1 -1
- package/.devcontainer/command-aliases.sh +152 -2
- package/.devcontainer/demarrage.sh +18 -15
- package/.devcontainer/devcontainer.json +1 -1
- package/.devcontainer/devzone +114 -122
- package/.devcontainer/docker-relais.sh +2 -2
- package/.devcontainer/docker-sans-hote.sh +1 -1
- package/.devcontainer/etat-json.sh +16 -16
- package/.devcontainer/etat.sh +4 -4
- package/.devcontainer/gitlab/argocd.sh +54 -0
- package/.devcontainer/gitlab/chart.sh +39 -0
- package/.devcontainer/gitlab/gitlab.sh +35 -180
- package/.devcontainer/gitlab/installation.sh +34 -47
- package/.devcontainer/gitlab/secrets.sh +2 -2
- package/.devcontainer/gitlab/seed.sh +204 -0
- package/.devcontainer/gitlab/test-gitlab-restes.sh +16 -0
- package/.devcontainer/gitlab/test-gitlab.sh +14 -13
- package/.devcontainer/help.sh +40 -0
- package/.devcontainer/kube-compte.sh +2 -2
- package/.devcontainer/kube-config.sh +1 -1
- package/.devcontainer/kube-joignable.sh +2 -0
- package/.devcontainer/opencode.jsonc +1 -1
- package/.devcontainer/paquets.sh +31 -18
- package/.devcontainer/ports-auto.sh +6 -6
- package/.devcontainer/ports-json.sh +34 -0
- package/.devcontainer/ports.sh +34 -43
- package/.devcontainer/post-create.sh +3 -3
- package/.devcontainer/postgres/postgres.sh +46 -32
- package/.devcontainer/services-admin.sh +13 -3
- package/.devcontainer/skills/devzone/SKILL.md +16 -16
- package/.devcontainer/versions.env +1 -1
- package/README.md +72 -40
- 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-mysql/values.yaml +3 -3
- package/charts/devzone-postgres/values.yaml +2 -2
- package/manage/scripts/check-charts.sh +67 -19
- package/manage/scripts/docker-workstation.sh +73 -0
- package/manage/scripts/lancer.sh +1 -1
- package/manage/scripts/migrer-retour.sh +1 -0
- package/manage/scripts/migrer.sh +6 -0
- package/manage/scripts/services-workspace.sh +11 -3
- 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/devzone
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# devzone état des modules
|
|
4
|
-
# devzone plateforme GitHub (défaut) ou GitLab
|
|
5
|
-
# devzone plateforme github retour à GitHub : glab et config retirés
|
|
6
|
-
# devzone plateforme gitlab GitLab, [--url URL] (défaut : module gitlab)
|
|
7
|
-
# devzone activer <module> active et applique tout de suite
|
|
8
|
-
# devzone desactiver <module> désactive et applique tout de suite
|
|
9
|
-
# devzone appliquer installe ce qui est actif (post-create.sh)
|
|
10
|
-
# devzone reparer répare relais Docker, gitlab, postgres, ports, identifiants
|
|
11
|
-
# devzone demarrer démarrage complet (scripts de démarrage et récapitulatif)
|
|
12
|
-
# devzone metrics [contexte…] installe metrics-server (kubectl top, k9s)
|
|
13
|
-
# devzone utiliser CTX [--confirmer CTX] bascule le cluster de travail de kubectl
|
|
14
|
-
# devzone clusters vue des clusters connectés (travail et services)
|
|
15
|
-
# devzone actif <module> code 0 si actif (scripts de démarrage)
|
|
16
|
-
# devzone test-bash32 lance les tests bats sous bash 3.2 (conteneur Docker)
|
|
17
|
-
# devzone test-gitlab essai de bout en bout du module et de la plateforme GitLab
|
|
18
|
-
# devzone agent <dossier> <fichier-consigne> dirige opencode sur une consigne
|
|
19
|
-
# devzone ticket <n> [--repo devzone|repowarden] worktree du ticket (ticket done <n> le retire)
|
|
20
|
-
# devzone build <dossier> [--tag <nom>] construit une image dans le workspace Kubernetes (BuildKit)
|
|
21
|
-
# devzone activer postgres [--contexte CTX] [--confirmer CTX] PostgreSQL partagé, cluster au choix
|
|
22
|
-
# devzone postgres creer <projet> base et utilisateur d'un projet (aussi : liste, psql, supprimer)
|
|
23
|
-
# devzone mysql creer <projet> base et utilisateur d'un projet MySQL (aussi : liste, supprimer)
|
|
24
|
-
# devzone gitlab migrer [--oui] GitLab dans le cluster des services, puis ancien cluster kind supprimé
|
|
25
|
-
# devzone gitlab nouveau-mdp [root|dev] mot de passe aléatoire (root ou dev) régénéré
|
|
26
|
-
# devzone activer argocd Argo CD dans le cluster des services, accès https://127.0.0.1:8443
|
|
27
|
-
# devzone argocd etat|relais-lancer|relais-arreter Argo CD (module argocd)
|
|
28
|
-
# devzone argocd app add <repo url> [path]|list|remove <N> projets déployés par Argo CD (#516)
|
|
29
|
-
# devzone cluster [CTX] [--oui] [--confirmer CTX] cluster des services de devzone, ou en changer
|
|
30
|
-
# devzone port [<n>|--fermer <n>] relais d'un port du conteneur vers le poste
|
|
31
|
-
# devzone mots-de-passe régénère .password et affiche son chemin
|
|
32
|
-
# devzone paquets [ajouter|retirer|appliquer] … paquets système gardés après un rebuild
|
|
2
|
+
# Aide de devzone (devzone --help) : .devcontainer/help.sh, sourcé ci-dessous.
|
|
33
3
|
#
|
|
34
4
|
# État propre à chaque instance : $RACINE/.devzone.modules (dossier monté
|
|
35
5
|
# de l'hôte, survit aux rebuilds), une ligne « module=on|off » ; la plateforme
|
|
@@ -50,6 +20,9 @@ while [ -L "$SOURCE" ]; do
|
|
|
50
20
|
esac
|
|
51
21
|
done
|
|
52
22
|
ICI="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
23
|
+
# shellcheck source=SCRIPTDIR/help.sh
|
|
24
|
+
# shellcheck disable=SC1091
|
|
25
|
+
. "$ICI/help.sh"
|
|
53
26
|
VERSIONS="$ICI/../manage/scripts/versions.sh"
|
|
54
27
|
# Dossier de devzone (/workspaces/devzone) ; DEVZONE_RACINE pour les tests
|
|
55
28
|
RACINE="${DEVZONE_RACINE:-$(dirname "$ICI")}"
|
|
@@ -74,7 +47,7 @@ if [ -f "$ICI/argocd/conf.sh" ]; then
|
|
|
74
47
|
. "$ICI/argocd/conf.sh"
|
|
75
48
|
fi
|
|
76
49
|
|
|
77
|
-
# Assistants IA, versions figées : mettre à jour ici, puis devzone
|
|
50
|
+
# Assistants IA, versions figées : mettre à jour ici, puis devzone apply
|
|
78
51
|
# (ou Rebuild Container). Une ligne par paquet, séparées par une ligne qui ne
|
|
79
52
|
# change pas : deux montées simultanées (workflow versions) se fusionnent sans
|
|
80
53
|
# conflit, git n'en signalant qu'entre lignes voisines modifiées.
|
|
@@ -218,7 +191,7 @@ retirer_config_opencode() {
|
|
|
218
191
|
|
|
219
192
|
# Repère de la skill devzone : posée si absente, mise à jour si elle porte le
|
|
220
193
|
# repère et n'a pas été modifiée, gardée si personnalisée (#161, règle opencode).
|
|
221
|
-
SKILL_REPERE='<!-- devzone : skill posée par devzone
|
|
194
|
+
SKILL_REPERE='<!-- devzone : skill posée par devzone enable ia -->'
|
|
222
195
|
# Empreinte de la version posée, à côté de SKILL.md : elle distingue une skill
|
|
223
196
|
# non modifiée d'une skill personnalisée qui garde encore le repère.
|
|
224
197
|
SKILL_EMPREINTE='.devzone-empreinte'
|
|
@@ -425,7 +398,7 @@ appliquer_ia() {
|
|
|
425
398
|
if ! installer_ia; then
|
|
426
399
|
journal="$(dernier_journal_npm)"
|
|
427
400
|
echo "journal npm : $journal" >"$(fichier_echec ia)"
|
|
428
|
-
echo "devzone : échec de l'installation de ${IA_FAILED[*]} (npm install -g, 3 essais) ; journal npm : $journal ; réessayer : devzone
|
|
401
|
+
echo "devzone : échec de l'installation de ${IA_FAILED[*]} (npm install -g, 3 essais) ; journal npm : $journal ; réessayer : devzone apply" >&2
|
|
429
402
|
return 1
|
|
430
403
|
fi
|
|
431
404
|
rm -f "$(fichier_echec ia)"
|
|
@@ -448,8 +421,10 @@ appliquer_ia() {
|
|
|
448
421
|
rm -f "$(fichier_echec ia)"
|
|
449
422
|
# Garde-fou repowarden : retiré à la désactivation (symétrique de
|
|
450
423
|
# l'activation). repowarden le fait lui-même s'il est présent ; sinon
|
|
451
|
-
# retrait par jq
|
|
452
|
-
#
|
|
424
|
+
# retrait par jq des seules entrées PreToolUse qui appellent le garde-fou,
|
|
425
|
+
# le reste de settings.json intact. Le garde-fou s'appelle « repowarden
|
|
426
|
+
# guard » depuis repowarden 4.17.3 ; « repowarden garde » est son ancien
|
|
427
|
+
# nom, toujours alias côté repowarden et reconnu ici.
|
|
453
428
|
if command -v repowarden >/dev/null 2>&1; then
|
|
454
429
|
repowarden agents retirer --global >/dev/null 2>&1 || true
|
|
455
430
|
elif [ -f "$HOME/.claude/settings.json" ]; then
|
|
@@ -459,10 +434,10 @@ appliquer_ia() {
|
|
|
459
434
|
.hooks.PreToolUse = [
|
|
460
435
|
.hooks.PreToolUse[] |
|
|
461
436
|
if (.hooks // null) != null then
|
|
462
|
-
.hooks = [ .hooks[] | select(((.command // "") | contains("repowarden garde")) | not) ] |
|
|
437
|
+
.hooks = [ .hooks[] | select(((.command // "") | (contains("repowarden garde") or contains("repowarden guard"))) | not) ] |
|
|
463
438
|
select((.hooks | length) > 0)
|
|
464
439
|
else
|
|
465
|
-
select(((.command // "") | contains("repowarden garde")) | not)
|
|
440
|
+
select(((.command // "") | (contains("repowarden garde") or contains("repowarden guard"))) | not)
|
|
466
441
|
end
|
|
467
442
|
] |
|
|
468
443
|
if (.hooks.PreToolUse | length) == 0 then del(.hooks.PreToolUse) else . end |
|
|
@@ -504,7 +479,7 @@ appliquer_gitlab() {
|
|
|
504
479
|
local etat_courant
|
|
505
480
|
if [ "$1" = on ]; then
|
|
506
481
|
# Saut si l'état est prêt et le runner en ligne ; sinon installer reprend
|
|
507
|
-
etat_courant="$(bash "$ICI/gitlab/gitlab.sh"
|
|
482
|
+
etat_courant="$(bash "$ICI/gitlab/gitlab.sh" status)"
|
|
508
483
|
if [[ "$etat_courant" == *"prêt"* && "$etat_courant" == *"runner en ligne"* ]]; then
|
|
509
484
|
echo "devzone : gitlab déjà actif, rien à faire."
|
|
510
485
|
# /etc/hosts régénéré par Docker : gitlab.localhost re-pose ici aussi
|
|
@@ -513,7 +488,7 @@ appliquer_gitlab() {
|
|
|
513
488
|
rm -f "$(fichier_echec gitlab)"
|
|
514
489
|
else
|
|
515
490
|
echo "devzone : gitlab activation via installer…"
|
|
516
|
-
if ! bash "$ICI/gitlab/gitlab.sh"
|
|
491
|
+
if ! bash "$ICI/gitlab/gitlab.sh" install; then
|
|
517
492
|
echo "gitlab" > "$(fichier_echec gitlab)"
|
|
518
493
|
return 1
|
|
519
494
|
fi
|
|
@@ -524,9 +499,9 @@ appliquer_gitlab() {
|
|
|
524
499
|
if bash "$ICI/gitlab/gitlab.sh" installe; then
|
|
525
500
|
echo "devzone : gitlab désactivation…"
|
|
526
501
|
if [ -n "${SUPPRIMER_DONNEES:-}" ]; then
|
|
527
|
-
bash "$ICI/gitlab/gitlab.sh"
|
|
502
|
+
bash "$ICI/gitlab/gitlab.sh" uninstall --yes
|
|
528
503
|
else
|
|
529
|
-
bash "$ICI/gitlab/gitlab.sh"
|
|
504
|
+
bash "$ICI/gitlab/gitlab.sh" uninstall
|
|
530
505
|
fi
|
|
531
506
|
else
|
|
532
507
|
echo "devzone : gitlab déjà désactivé (aucun namespace devzone-gitlab)."
|
|
@@ -535,7 +510,7 @@ appliquer_gitlab() {
|
|
|
535
510
|
}
|
|
536
511
|
|
|
537
512
|
# PostgreSQL partagé (#280) : installé sur le cluster de devzone, choisi à la
|
|
538
|
-
# première activation (--
|
|
513
|
+
# première activation (--context, menu en terminal, kind dédié sinon)
|
|
539
514
|
appliquer_postgres() {
|
|
540
515
|
local voulu="" confirmer="" attendre="" arg ctx actuel etat_courant
|
|
541
516
|
if [ "$1" = on ]; then
|
|
@@ -549,9 +524,9 @@ appliquer_postgres() {
|
|
|
549
524
|
continue
|
|
550
525
|
fi
|
|
551
526
|
case "$arg" in
|
|
552
|
-
--
|
|
553
|
-
--
|
|
554
|
-
*) echo "devzone : argument inconnu : $arg (devzone
|
|
527
|
+
--context) attendre=contexte ;;
|
|
528
|
+
--confirm) attendre=confirmer ;;
|
|
529
|
+
*) echo "devzone : argument inconnu : $arg (devzone enable postgres --context CTX [--confirm CTX])" >&2; ecrire postgres off; return 2 ;;
|
|
555
530
|
esac
|
|
556
531
|
done
|
|
557
532
|
if [ -n "$attendre" ]; then
|
|
@@ -566,49 +541,49 @@ appliquer_postgres() {
|
|
|
566
541
|
return 2
|
|
567
542
|
fi
|
|
568
543
|
if [ -n "$confirmer" ]; then
|
|
569
|
-
ctx="$(cluster_choisir "$voulu" --
|
|
544
|
+
ctx="$(cluster_choisir "$voulu" --confirm "$confirmer")" || { ecrire postgres off; return 2; }
|
|
570
545
|
else
|
|
571
546
|
ctx="$(cluster_choisir "$voulu")" || { ecrire postgres off; return 2; }
|
|
572
547
|
fi
|
|
573
548
|
# Choix gardé avant l'installation : une reprise vise le même cluster
|
|
574
549
|
cluster_ecrire "$ctx"
|
|
575
|
-
etat_courant="$(bash "$ICI/postgres/postgres.sh"
|
|
550
|
+
etat_courant="$(bash "$ICI/postgres/postgres.sh" status)"
|
|
576
551
|
# « relais arrêté » d'abord : cette ligne commence aussi par « prêt sur »
|
|
577
552
|
if [[ "$etat_courant" == *"relais arrêté"* ]]; then
|
|
578
|
-
bash "$ICI/postgres/postgres.sh"
|
|
553
|
+
bash "$ICI/postgres/postgres.sh" relay-start
|
|
579
554
|
echo "devzone : postgres : relais relancé"
|
|
580
555
|
elif [[ "$etat_courant" == "prêt sur"* ]]; then
|
|
581
556
|
echo "devzone : postgres déjà actif, rien à faire."
|
|
582
|
-
elif ! bash "$ICI/postgres/postgres.sh"
|
|
557
|
+
elif ! bash "$ICI/postgres/postgres.sh" install; then
|
|
583
558
|
echo "postgres" >"$(fichier_echec postgres)"
|
|
584
559
|
return 1
|
|
585
560
|
fi
|
|
586
561
|
rm -f "$(fichier_echec postgres)"
|
|
587
562
|
else
|
|
588
|
-
bash "$ICI/postgres/postgres.sh"
|
|
563
|
+
bash "$ICI/postgres/postgres.sh" uninstall
|
|
589
564
|
rm -f "$(fichier_echec postgres)"
|
|
590
565
|
fi
|
|
591
566
|
}
|
|
592
567
|
|
|
593
568
|
# Argo CD (#411) : installé dans le cluster des services, accès par le relais
|
|
594
|
-
# 127.0.0.1:8443 ; un échec est marqué dans l'état et repris par devzone
|
|
569
|
+
# 127.0.0.1:8443 ; un échec est marqué dans l'état et repris par devzone apply
|
|
595
570
|
appliquer_argocd() {
|
|
596
571
|
local etat_courant
|
|
597
572
|
if [ "$1" = on ]; then
|
|
598
|
-
etat_courant="$(bash "$ICI/argocd/argocd.sh"
|
|
573
|
+
etat_courant="$(bash "$ICI/argocd/argocd.sh" status)"
|
|
599
574
|
# « relais arrêté » d'abord : cette ligne commence aussi par « prêt »
|
|
600
575
|
if [[ "$etat_courant" == *"relais arrêté"* ]]; then
|
|
601
|
-
bash "$ICI/argocd/argocd.sh"
|
|
576
|
+
bash "$ICI/argocd/argocd.sh" relay-start
|
|
602
577
|
echo "devzone : argocd : relais relancé"
|
|
603
578
|
elif [[ "$etat_courant" == "prêt"* ]]; then
|
|
604
579
|
echo "devzone : argocd déjà actif, rien à faire."
|
|
605
|
-
elif ! bash "$ICI/argocd/argocd.sh"
|
|
580
|
+
elif ! bash "$ICI/argocd/argocd.sh" install; then
|
|
606
581
|
echo "argocd" >"$(fichier_echec argocd)"
|
|
607
582
|
return 1
|
|
608
583
|
fi
|
|
609
584
|
rm -f "$(fichier_echec argocd)"
|
|
610
585
|
else
|
|
611
|
-
bash "$ICI/argocd/argocd.sh"
|
|
586
|
+
bash "$ICI/argocd/argocd.sh" uninstall
|
|
612
587
|
rm -f "$(fichier_echec argocd)"
|
|
613
588
|
fi
|
|
614
589
|
}
|
|
@@ -620,19 +595,19 @@ appliquer_mysql() {
|
|
|
620
595
|
if [ "$1" = on ]; then
|
|
621
596
|
ctx="$(cluster_lu)"
|
|
622
597
|
if [ -z "$ctx" ]; then
|
|
623
|
-
echo "devzone : mysql : aucun cluster choisi : devzone
|
|
598
|
+
echo "devzone : mysql : aucun cluster choisi : devzone enable mysql" >&2
|
|
624
599
|
ecrire mysql off
|
|
625
600
|
echo mysql >"$(fichier_echec mysql)"
|
|
626
601
|
return 2
|
|
627
602
|
fi
|
|
628
|
-
etat_courant="$(bash "$ICI/catalogue/mysql/mysql.sh"
|
|
603
|
+
etat_courant="$(bash "$ICI/catalogue/mysql/mysql.sh" status)"
|
|
629
604
|
# « relais arrêté » d'abord : cette ligne commence aussi par « prêt sur »
|
|
630
605
|
if [[ "$etat_courant" == *"relais arrêté"* ]]; then
|
|
631
|
-
bash "$ICI/catalogue/mysql/mysql.sh"
|
|
606
|
+
bash "$ICI/catalogue/mysql/mysql.sh" relay-start
|
|
632
607
|
echo "devzone : mysql : relais relancé"
|
|
633
608
|
elif [[ "$etat_courant" == "prêt sur"* ]]; then
|
|
634
609
|
echo "devzone : mysql déjà actif, rien à faire."
|
|
635
|
-
elif ! bash "$ICI/catalogue/mysql/mysql.sh"
|
|
610
|
+
elif ! bash "$ICI/catalogue/mysql/mysql.sh" install; then
|
|
636
611
|
echo mysql >"$(fichier_echec mysql)"
|
|
637
612
|
return 1
|
|
638
613
|
fi
|
|
@@ -640,23 +615,24 @@ appliquer_mysql() {
|
|
|
640
615
|
else
|
|
641
616
|
# Retrait sans suppression des données : volume gardé (#441) ; les
|
|
642
617
|
# bases ne partent qu'avec un oui (confirmer_suppression)
|
|
643
|
-
bash "$ICI/catalogue.sh"
|
|
618
|
+
bash "$ICI/catalogue.sh" remove mysql
|
|
644
619
|
if [ -n "${SUPPRIMER_DONNEES:-}" ]; then
|
|
645
|
-
bash "$ICI/catalogue/mysql/mysql.sh"
|
|
620
|
+
bash "$ICI/catalogue/mysql/mysql.sh" delete-data --yes
|
|
646
621
|
fi
|
|
647
622
|
rm -f "$(fichier_echec mysql)"
|
|
648
623
|
fi
|
|
649
624
|
}
|
|
650
625
|
|
|
651
626
|
# Toutes les bases disparaissent : confirmation en terminal (sans terminal, la
|
|
652
|
-
# commande est explicite) ; un oui ou --
|
|
653
|
-
# appliquer_mysql pour lancer supprimer-donnees (#441)
|
|
627
|
+
# commande est explicite) ; un oui ou --yes marque SUPPRIMER_DONNEES, lu par
|
|
628
|
+
# appliquer_mysql pour lancer supprimer-donnees (#441). Les arguments passent
|
|
629
|
+
# par canonical_args : --oui arrive ici déjà traduit en --yes (#557).
|
|
654
630
|
confirmer_suppression() {
|
|
655
631
|
local app="$1" reponse arg
|
|
656
632
|
SUPPRIMER_DONNEES=""
|
|
657
633
|
[ "$(valeur "$app")" = on ] || return 0
|
|
658
634
|
for arg in "${@:2}"; do
|
|
659
|
-
case "$arg" in --
|
|
635
|
+
case "$arg" in --yes) SUPPRIMER_DONNEES=1 ;; esac
|
|
660
636
|
done
|
|
661
637
|
[ -z "$SUPPRIMER_DONNEES" ] || return 0
|
|
662
638
|
cluster_interactif || return 0
|
|
@@ -681,7 +657,7 @@ confirmer_suppression() {
|
|
|
681
657
|
esac
|
|
682
658
|
}
|
|
683
659
|
|
|
684
|
-
# devzone cluster [CTX] [--
|
|
660
|
+
# devzone cluster [CTX] [--yes] : affiche le cluster des services, ou les y
|
|
685
661
|
# déplace (désinstallés de l'ancien, installés sur le nouveau : données non
|
|
686
662
|
# migrées, d'où la confirmation)
|
|
687
663
|
changer_cluster() {
|
|
@@ -694,20 +670,20 @@ changer_cluster() {
|
|
|
694
670
|
continue
|
|
695
671
|
fi
|
|
696
672
|
case "$arg" in
|
|
697
|
-
--
|
|
698
|
-
--
|
|
699
|
-
-*) echo "devzone : argument inconnu : $arg (devzone cluster [CTX] [--
|
|
673
|
+
--yes) oui=1 ;;
|
|
674
|
+
--confirm) attendre=1 ;;
|
|
675
|
+
-*) echo "devzone : argument inconnu : $arg (devzone cluster [CTX] [--yes] [--confirm CTX])" >&2; return 2 ;;
|
|
700
676
|
*) voulu="$arg" ;;
|
|
701
677
|
esac
|
|
702
678
|
done
|
|
703
679
|
if [ -n "$attendre" ]; then
|
|
704
|
-
echo "devzone : --
|
|
680
|
+
echo "devzone : --confirm attend un contexte" >&2
|
|
705
681
|
return 2
|
|
706
682
|
fi
|
|
707
683
|
actuel="$(cluster_lu)"
|
|
708
684
|
if [ -z "$voulu" ]; then
|
|
709
685
|
if [ -z "$actuel" ]; then
|
|
710
|
-
echo "devzone : aucun cluster choisi (fixé à l'activation d'un module : devzone
|
|
686
|
+
echo "devzone : aucun cluster choisi (fixé à l'activation d'un module : devzone enable postgres)"
|
|
711
687
|
elif cluster_est_dedie "$actuel"; then
|
|
712
688
|
echo "devzone : cluster $actuel (kind dédié, dans le conteneur)"
|
|
713
689
|
else
|
|
@@ -717,7 +693,7 @@ changer_cluster() {
|
|
|
717
693
|
return 0
|
|
718
694
|
fi
|
|
719
695
|
if [ -n "$confirmer" ]; then
|
|
720
|
-
nouveau="$(cluster_choisir "$voulu" --
|
|
696
|
+
nouveau="$(cluster_choisir "$voulu" --confirm "$confirmer")" || return 2
|
|
721
697
|
else
|
|
722
698
|
nouveau="$(cluster_choisir "$voulu")" || return 2
|
|
723
699
|
fi
|
|
@@ -730,7 +706,7 @@ changer_cluster() {
|
|
|
730
706
|
if [ "$(valeur postgres)" = on ]; then
|
|
731
707
|
if [ -z "$oui" ]; then
|
|
732
708
|
if ! cluster_interactif; then
|
|
733
|
-
echo "devzone : les bases postgres seront supprimées de $ctx_ancien (non migrées) : devzone cluster $ctx_new --
|
|
709
|
+
echo "devzone : les bases postgres seront supprimées de $ctx_ancien (non migrées) : devzone cluster $ctx_new --yes" >&2
|
|
734
710
|
return 1
|
|
735
711
|
fi
|
|
736
712
|
printf 'postgres sera réinstallé sur %s, ses bases supprimées de %s (non migrées). Continuer ? [o/N] ' "$ctx_new" "$ctx_ancien" >&2
|
|
@@ -755,7 +731,7 @@ changer_cluster() {
|
|
|
755
731
|
return 1
|
|
756
732
|
fi
|
|
757
733
|
# Installe PostgreSQL sur le nouveau cluster (via --context devzone qui pointe maintenant dessus)
|
|
758
|
-
bash "$ICI/postgres/postgres.sh"
|
|
734
|
+
bash "$ICI/postgres/postgres.sh" install
|
|
759
735
|
else
|
|
760
736
|
cluster_ecrire "$ctx_new"
|
|
761
737
|
# Pose le contexte devzone sur le nouveau cluster (cluster + user :
|
|
@@ -813,7 +789,7 @@ ligne_plateforme() {
|
|
|
813
789
|
fi
|
|
814
790
|
}
|
|
815
791
|
|
|
816
|
-
# Affichage simple de la plateforme (devzone
|
|
792
|
+
# Affichage simple de la plateforme (devzone platform)
|
|
817
793
|
resume_plateforme() {
|
|
818
794
|
local url hote
|
|
819
795
|
if [ "$(plateforme_lue)" = gitlab ]; then
|
|
@@ -844,7 +820,7 @@ installer_glab() {
|
|
|
844
820
|
archive="$(mktemp)"
|
|
845
821
|
if ! curl -fsSL -o "$archive" "https://gitlab.com/gitlab-org/cli/-/releases/$GLAB_VERSION/downloads/glab_${GLAB_VERSION#v}_linux_${arch}.tar.gz"; then
|
|
846
822
|
rm -f "$archive"
|
|
847
|
-
echo "devzone : téléchargement de glab impossible (release officielle de gitlab.com) ; réessayer : devzone
|
|
823
|
+
echo "devzone : téléchargement de glab impossible (release officielle de gitlab.com) ; réessayer : devzone platform gitlab --url URL" >&2
|
|
848
824
|
return 1
|
|
849
825
|
fi
|
|
850
826
|
if [ "$(sha256sum "$archive" | cut -d' ' -f1)" != "$somme" ]; then
|
|
@@ -876,12 +852,12 @@ connexion_glab() {
|
|
|
876
852
|
local hote="$1" url="$2" jeton
|
|
877
853
|
if [ "$url" = "$GITLAB_URL_MODULE" ]; then
|
|
878
854
|
if [ ! -f "$RACINE/workspace/.gitlab/root-token" ]; then
|
|
879
|
-
echo "devzone : jeton root du module gitlab introuvable ($RACINE/workspace/.gitlab/root-token) : devzone
|
|
855
|
+
echo "devzone : jeton root du module gitlab introuvable ($RACINE/workspace/.gitlab/root-token) : devzone enable gitlab, ou à la main : glab auth login --hostname $hote" >&2
|
|
880
856
|
return 1
|
|
881
857
|
fi
|
|
882
858
|
jeton="$(cat "$RACINE/workspace/.gitlab/root-token")"
|
|
883
859
|
if ! "$GLAB" auth login --hostname "$hote" --api-protocol http --git-protocol http --token "$jeton"; then
|
|
884
|
-
echo "devzone : connexion à l'instance gitlab impossible : devzone
|
|
860
|
+
echo "devzone : connexion à l'instance gitlab impossible : devzone enable gitlab, ou à la main : glab auth login --hostname $hote" >&2
|
|
885
861
|
return 1
|
|
886
862
|
fi
|
|
887
863
|
elif ! "$GLAB" auth login --hostname "$hote"; then
|
|
@@ -913,7 +889,7 @@ changer_plateforme() {
|
|
|
913
889
|
if [ -n "$attendre" ]; then url="$arg"; attendre=""; continue; fi
|
|
914
890
|
case "$arg" in
|
|
915
891
|
--url) attendre=1 ;;
|
|
916
|
-
*) echo "devzone : argument inconnu : $arg (devzone
|
|
892
|
+
*) echo "devzone : argument inconnu : $arg (devzone platform gitlab --url URL)" >&2; return 1 ;;
|
|
917
893
|
esac
|
|
918
894
|
done
|
|
919
895
|
if [ -n "$attendre" ]; then
|
|
@@ -924,7 +900,7 @@ changer_plateforme() {
|
|
|
924
900
|
if [ "$(valeur gitlab)" = on ]; then
|
|
925
901
|
url="$GITLAB_URL_MODULE"
|
|
926
902
|
else
|
|
927
|
-
echo "devzone : URL manquante : devzone
|
|
903
|
+
echo "devzone : URL manquante : devzone platform gitlab --url URL (ou un module gitlab actif pour l'instance locale)" >&2
|
|
928
904
|
return 1
|
|
929
905
|
fi
|
|
930
906
|
fi
|
|
@@ -1061,7 +1037,7 @@ ligne_version_disponible() {
|
|
|
1061
1037
|
publiee="${publiee#v}"
|
|
1062
1038
|
[ -n "$publiee" ] || return 0
|
|
1063
1039
|
if version_plus_recente "$publiee" "$dossier"; then
|
|
1064
|
-
printf ' ○ devzone %s
|
|
1040
|
+
printf ' ○ devzone %s available: on the workstation, devzone update\n' "$publiee"
|
|
1065
1041
|
fi
|
|
1066
1042
|
}
|
|
1067
1043
|
|
|
@@ -1093,19 +1069,22 @@ reparer() {
|
|
|
1093
1069
|
fi
|
|
1094
1070
|
if [ "$(valeur gitlab)" = on ]; then
|
|
1095
1071
|
reparer_element "nom gitlab" bash "$ICI/gitlab/gitlab.sh" hote-poser
|
|
1096
|
-
reparer_element "relais gitlab" bash "$ICI/gitlab/gitlab.sh"
|
|
1072
|
+
reparer_element "relais gitlab" bash "$ICI/gitlab/gitlab.sh" relay-start
|
|
1097
1073
|
fi
|
|
1098
1074
|
if [ "$(valeur postgres)" = on ]; then
|
|
1099
|
-
reparer_element "relais postgres" bash "$ICI/postgres/postgres.sh"
|
|
1075
|
+
reparer_element "relais postgres" bash "$ICI/postgres/postgres.sh" relay-start
|
|
1100
1076
|
fi
|
|
1101
1077
|
if [ "$(valeur argocd)" = on ]; then
|
|
1102
|
-
reparer_element "relais argocd" bash "$ICI/argocd/argocd.sh"
|
|
1078
|
+
reparer_element "relais argocd" bash "$ICI/argocd/argocd.sh" relay-start
|
|
1103
1079
|
fi
|
|
1104
1080
|
if [ "$(valeur mysql)" = on ]; then
|
|
1105
|
-
reparer_element "relais mysql" bash "$ICI/catalogue/mysql/mysql.sh"
|
|
1081
|
+
reparer_element "relais mysql" bash "$ICI/catalogue/mysql/mysql.sh" relay-start
|
|
1082
|
+
fi
|
|
1083
|
+
reparer_element "relais de ports" bash "$ICI/ports.sh" restart
|
|
1084
|
+
# Kubernetes workspace (#517): no automatic port watcher
|
|
1085
|
+
if ! dans_pod; then
|
|
1086
|
+
reparer_element "veilleur ports auto" env DEVZONE_PORTS_AUTO_REEL=oui bash "$ICI/ports-auto.sh" demarrer
|
|
1106
1087
|
fi
|
|
1107
|
-
reparer_element "relais de ports" bash "$ICI/ports.sh" relancer
|
|
1108
|
-
reparer_element "veilleur ports auto" env DEVZONE_PORTS_AUTO_REEL=oui bash "$ICI/ports-auto.sh" demarrer
|
|
1109
1088
|
reparer_element "veilleur catalogue" env DEVZONE_CATALOGUE_REEL=oui bash "$ICI/catalogue/catalogue-veilleur.sh" demarrer
|
|
1110
1089
|
reparer_element "identifiants" bash "$ICI/password.sh" regenerer
|
|
1111
1090
|
return "$reparer_echec"
|
|
@@ -1129,22 +1108,22 @@ utiliser() {
|
|
|
1129
1108
|
shift
|
|
1130
1109
|
;;
|
|
1131
1110
|
--namespace=*) namespace="${arg#*=}" ;;
|
|
1132
|
-
--
|
|
1111
|
+
--confirm)
|
|
1133
1112
|
if [ "$#" -eq 0 ]; then
|
|
1134
|
-
echo "devzone : --
|
|
1113
|
+
echo "devzone : --confirm attend un contexte" >&2
|
|
1135
1114
|
return 2
|
|
1136
1115
|
fi
|
|
1137
1116
|
confirmer="$1"
|
|
1138
1117
|
shift
|
|
1139
1118
|
;;
|
|
1140
|
-
--
|
|
1119
|
+
--confirm=*) confirmer="${arg#*=}" ;;
|
|
1141
1120
|
-*)
|
|
1142
|
-
echo "devzone : argument inconnu : $arg (devzone
|
|
1121
|
+
echo "devzone : argument inconnu : $arg (devzone use CTX [-n NS] [--confirm CTX])" >&2
|
|
1143
1122
|
return 2
|
|
1144
1123
|
;;
|
|
1145
1124
|
*)
|
|
1146
1125
|
if [ -n "$ctx" ]; then
|
|
1147
|
-
echo "devzone : argument inconnu : $arg (devzone
|
|
1126
|
+
echo "devzone : argument inconnu : $arg (devzone use CTX [-n NS] [--confirm CTX])" >&2
|
|
1148
1127
|
return 2
|
|
1149
1128
|
fi
|
|
1150
1129
|
ctx="$arg"
|
|
@@ -1153,7 +1132,7 @@ utiliser() {
|
|
|
1153
1132
|
done
|
|
1154
1133
|
if [ -z "$ctx" ]; then
|
|
1155
1134
|
if [ -z "$namespace" ]; then
|
|
1156
|
-
echo "devzone : contexte manquant : devzone
|
|
1135
|
+
echo "devzone : contexte manquant : devzone use CTX" >&2
|
|
1157
1136
|
return 2
|
|
1158
1137
|
fi
|
|
1159
1138
|
courant="$(kubectl config current-context 2>/dev/null || true)"
|
|
@@ -1172,18 +1151,18 @@ utiliser() {
|
|
|
1172
1151
|
if ! cluster_est_local "$ctx"; then
|
|
1173
1152
|
if [ -n "$confirmer" ]; then
|
|
1174
1153
|
if [ "$confirmer" != "$ctx" ]; then
|
|
1175
|
-
echo "devzone : cluster distant refusé : $ctx (--
|
|
1154
|
+
echo "devzone : cluster distant refusé : $ctx (--confirm $ctx)" >&2
|
|
1176
1155
|
return 2
|
|
1177
1156
|
fi
|
|
1178
1157
|
elif cluster_interactif; then
|
|
1179
1158
|
printf 'cluster distant : %s ; tape son nom pour confirmer : ' "$ctx" >&2
|
|
1180
1159
|
read -r reponse || reponse=""
|
|
1181
1160
|
if [ "$reponse" != "$ctx" ]; then
|
|
1182
|
-
echo "devzone : cluster distant refusé : $ctx (--
|
|
1161
|
+
echo "devzone : cluster distant refusé : $ctx (--confirm $ctx)" >&2
|
|
1183
1162
|
return 2
|
|
1184
1163
|
fi
|
|
1185
1164
|
else
|
|
1186
|
-
echo "devzone : cluster distant refusé : $ctx (--
|
|
1165
|
+
echo "devzone : cluster distant refusé : $ctx (--confirm $ctx)" >&2
|
|
1187
1166
|
return 2
|
|
1188
1167
|
fi
|
|
1189
1168
|
fi
|
|
@@ -1200,14 +1179,14 @@ utiliser() {
|
|
|
1200
1179
|
# point à faire avec sa commande (affiché à chaque démarrage)
|
|
1201
1180
|
etat() {
|
|
1202
1181
|
local nom email statut m retards chemin ports_etat relais_marque ctx_travail ctx_hote paquets_marque paquets_noms argocd_repo
|
|
1203
|
-
echo "devzone
|
|
1182
|
+
echo "devzone: state (devzone to show it again)"
|
|
1204
1183
|
ligne_version_disponible
|
|
1205
1184
|
nom="$(git config --get user.name || true)"
|
|
1206
1185
|
email="$(git config --get user.email || true)"
|
|
1207
1186
|
if [ -n "$nom" ] && [ -n "$email" ]; then
|
|
1208
|
-
echo " ✔
|
|
1187
|
+
echo " ✔ git identity $nom <$email>"
|
|
1209
1188
|
else
|
|
1210
|
-
echo " ✖
|
|
1189
|
+
echo " ✖ git identity needed to commit: gh auth login -s workflow (automatic),"
|
|
1211
1190
|
echo " ou git config --file ~/.config/git/config user.name \"<nom>\" et user.email \"<email>\""
|
|
1212
1191
|
fi
|
|
1213
1192
|
if [ "$(plateforme_lue)" = gitlab ]; then
|
|
@@ -1217,16 +1196,16 @@ etat() {
|
|
|
1217
1196
|
ligne_plateforme
|
|
1218
1197
|
url="$(url_gitlab_lue)"
|
|
1219
1198
|
if git config --global --get "credential.$url.helper" 2>/dev/null | grep -q 'glab auth git-credential'; then
|
|
1220
|
-
echo " ✔ git
|
|
1199
|
+
echo " ✔ git via glab"
|
|
1221
1200
|
else
|
|
1222
|
-
echo " ⚠ git
|
|
1201
|
+
echo " ⚠ git via glab to set: devzone platform gitlab"
|
|
1223
1202
|
fi
|
|
1224
1203
|
echo " ○ GitHub inutile ici (plateforme gitlab choisie)"
|
|
1225
1204
|
echo " ⚠ repowarden reste sur GitHub (bots et tickets) : support GitLab à venir (simdevWarden/repowarden#531)"
|
|
1226
1205
|
else
|
|
1227
1206
|
ligne_plateforme
|
|
1228
1207
|
if ! statut="$(gh auth status 2>&1)"; then
|
|
1229
|
-
echo " ○ GitHub
|
|
1208
|
+
echo " ○ GitHub optional (push and PR, repowarden tickets) : gh auth login -s workflow"
|
|
1230
1209
|
elif grep -q "Token scopes:" <<<"$statut" && ! grep -q "'workflow'" <<<"$statut"; then
|
|
1231
1210
|
echo " ⚠ GitHub connecté, sans permission workflow (push de .github/workflows/ refusé) : gh auth refresh -h github.com -s workflow"
|
|
1232
1211
|
else
|
|
@@ -1235,11 +1214,11 @@ etat() {
|
|
|
1235
1214
|
fi
|
|
1236
1215
|
if retards="$(outils_retard)"; then
|
|
1237
1216
|
if [ -z "$retards" ]; then
|
|
1238
|
-
echo " ✔
|
|
1217
|
+
echo " ✔ tools pinned versions"
|
|
1239
1218
|
else
|
|
1240
1219
|
while read -r paquet figee installee; do
|
|
1241
1220
|
[ -n "$paquet" ] || continue
|
|
1242
|
-
echo " ⚠
|
|
1221
|
+
echo " ⚠ tools $paquet $installee installed, $figee pinned: devzone apply"
|
|
1243
1222
|
done <<<"$retards"
|
|
1244
1223
|
fi
|
|
1245
1224
|
fi
|
|
@@ -1252,20 +1231,20 @@ etat() {
|
|
|
1252
1231
|
# Kubernetes workspace pod (#528): presence by the cluster DNS
|
|
1253
1232
|
service_ligne_pod "$m"
|
|
1254
1233
|
elif [ "$(valeur "$m")" = on ] && [ -f "$(fichier_echec "$m")" ]; then
|
|
1255
|
-
printf ' ✖ module %-10s
|
|
1234
|
+
printf ' ✖ module %-10s failed: incomplete install (%s): devzone apply\n' "$m" "$(cat "$(fichier_echec "$m")")"
|
|
1256
1235
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = gitlab ]; then
|
|
1257
1236
|
# GitLab actif : son état réel (prêt, runner, en échec)
|
|
1258
|
-
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/gitlab/gitlab.sh"
|
|
1237
|
+
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/gitlab/gitlab.sh" status)"
|
|
1259
1238
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = postgres ]; then
|
|
1260
|
-
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/postgres/postgres.sh"
|
|
1239
|
+
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/postgres/postgres.sh" status)"
|
|
1261
1240
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = argocd ]; then
|
|
1262
|
-
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/argocd/argocd.sh"
|
|
1241
|
+
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/argocd/argocd.sh" status)"
|
|
1263
1242
|
elif [ "$(valeur "$m")" = on ] && [ "$m" = mysql ]; then
|
|
1264
|
-
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/catalogue/mysql/mysql.sh"
|
|
1243
|
+
printf ' ✔ module %-10s %s\n' "$m" "$(bash "$ICI/catalogue/mysql/mysql.sh" status)"
|
|
1265
1244
|
elif [ "$(valeur "$m")" = on ]; then
|
|
1266
|
-
printf ' ✔ module %-10s
|
|
1245
|
+
printf ' ✔ module %-10s active: %s\n' "$m" "$(description "$m")"
|
|
1267
1246
|
else
|
|
1268
|
-
printf ' ○ module %-10s
|
|
1247
|
+
printf ' ○ module %-10s optional, %s: devzone enable %s\n' "$m" "$(description "$m")" "$m"
|
|
1269
1248
|
fi
|
|
1270
1249
|
done
|
|
1271
1250
|
# GitOps repository of the instance (#539): the designation of .argocd.conf
|
|
@@ -1303,11 +1282,11 @@ etat() {
|
|
|
1303
1282
|
# Cluster de devzone distant : avertissement dans le récapitulatif
|
|
1304
1283
|
cluster_actuel="$(cluster_lu)"
|
|
1305
1284
|
if [ -n "$cluster_actuel" ] && ! cluster_est_local "$cluster_actuel"; then
|
|
1306
|
-
printf ' ⚠ cluster
|
|
1285
|
+
printf ' ⚠ cluster remote: %s — services on a remote cluster\n' "$cluster_actuel"
|
|
1307
1286
|
fi
|
|
1308
1287
|
# Ancien cluster kind-gitlab encore présent : inviter à migrer (#396)
|
|
1309
1288
|
if kind get clusters 2>/dev/null | grep -qx "gitlab${INSTANCE_SUFFIX}"; then
|
|
1310
|
-
printf ' ⚠
|
|
1289
|
+
printf ' ⚠ old kind-gitlab cluster%s: devzone gitlab migrate\n' "$INSTANCE_SUFFIX"
|
|
1311
1290
|
fi
|
|
1312
1291
|
# Cluster de travail interne (kind) : avertissement dans le recapitulatif
|
|
1313
1292
|
ctx_travail="$(kubectl config current-context 2>/dev/null || true)"
|
|
@@ -1315,7 +1294,7 @@ etat() {
|
|
|
1315
1294
|
kind-gitlab* | kind-devzone*)
|
|
1316
1295
|
ctx_hote="$(KUBECONFIG="${DEVZONE_KUBE_HOTE:-$HOME/.kube/hote.config}" kubectl config current-context 2>/dev/null || true)"
|
|
1317
1296
|
if [ -n "$ctx_hote" ] && cluster_joignable "$ctx_hote"; then
|
|
1318
|
-
printf ' ⚠ cluster de travail : %s (cluster interne de devzone) ; revenir : devzone
|
|
1297
|
+
printf ' ⚠ cluster de travail : %s (cluster interne de devzone) ; revenir : devzone use %s\n' "$ctx_travail" "$ctx_hote"
|
|
1319
1298
|
fi
|
|
1320
1299
|
;;
|
|
1321
1300
|
esac
|
|
@@ -1326,18 +1305,18 @@ etat() {
|
|
|
1326
1305
|
fi
|
|
1327
1306
|
ports_etat="$(bash "$ICI/ports.sh" resume 2>/dev/null || true)"
|
|
1328
1307
|
case "$ports_etat" in
|
|
1329
|
-
|
|
1330
|
-
*) printf ' ✔ ports
|
|
1308
|
+
none*) printf ' ○ ports to the workstation %s\n' "$ports_etat" ;;
|
|
1309
|
+
*) printf ' ✔ ports to the workstation %s\n' "$ports_etat" ;;
|
|
1331
1310
|
esac
|
|
1332
1311
|
# Identifiants regroupés (#332) : le chemin seulement, jamais le contenu
|
|
1333
1312
|
if [ -f "$RACINE/.password" ]; then
|
|
1334
|
-
printf ' ○
|
|
1313
|
+
printf ' ○ credentials: %s\n' "$RACINE/.password"
|
|
1335
1314
|
fi
|
|
1336
1315
|
# Marque posée par docker-relais.sh au démarrage (#293) : docker exec
|
|
1337
1316
|
# longs coupés, kind et modules en échec
|
|
1338
1317
|
relais_marque="${DEVZONE_RELAIS_MARQUE:-/tmp/devzone-relais-docker.echec}"
|
|
1339
1318
|
if [ -f "$relais_marque" ]; then
|
|
1340
|
-
printf ' ⚠
|
|
1319
|
+
printf ' ⚠ Docker relay %s: devzone repair\n' "$(head -1 "$relais_marque")"
|
|
1341
1320
|
fi
|
|
1342
1321
|
# Marque posee par paquets.sh a l echec de reapplication (351) : noms des paquets non installes
|
|
1343
1322
|
paquets_marque="${DEVZONE_PAQUETS_MARQUE:-/tmp/devzone-paquets.echec}"
|
|
@@ -1348,7 +1327,7 @@ etat() {
|
|
|
1348
1327
|
paquets_noms="${paquets_noms:+$paquets_noms, }$n"
|
|
1349
1328
|
fi
|
|
1350
1329
|
done < "$paquets_marque"
|
|
1351
|
-
echo " ⚠
|
|
1330
|
+
echo " ⚠ packages $paquets_noms: devzone packages"
|
|
1352
1331
|
fi
|
|
1353
1332
|
}
|
|
1354
1333
|
|
|
@@ -1375,7 +1354,7 @@ changer() {
|
|
|
1375
1354
|
# Une application du catalogue : on écrit la ligne, on applique
|
|
1376
1355
|
if [ -f "$ICI/catalogue/$m/app.conf" ]; then
|
|
1377
1356
|
ecrire "$m" "$1"
|
|
1378
|
-
bash "$ICI/catalogue.sh"
|
|
1357
|
+
bash "$ICI/catalogue.sh" apply
|
|
1379
1358
|
return
|
|
1380
1359
|
fi
|
|
1381
1360
|
echo "devzone : module inconnu : $m ; modules : ${MODULES[*]}" >&2
|
|
@@ -1396,6 +1375,8 @@ changer() {
|
|
|
1396
1375
|
confirmer_suppression "$m" "${@:3}" || return 0
|
|
1397
1376
|
fi
|
|
1398
1377
|
ecrire "$m" "$1"
|
|
1378
|
+
# Services held by Argo CD (#559): 0 done, 3 helm direct as before, else failed
|
|
1379
|
+
if DEVZONE_ETAT="$ETAT" bash "$ICI/argocd/services-hook.sh" "$m" "$1"; then return 0; elif [ $? -ne 3 ]; then return 1; fi
|
|
1399
1380
|
"appliquer_$m" "$1" "${@:3}"
|
|
1400
1381
|
}
|
|
1401
1382
|
|
|
@@ -1415,6 +1396,17 @@ if [ "$#" -gt 0 ]; then
|
|
|
1415
1396
|
set -- "$canon" "${@:2}"
|
|
1416
1397
|
fi
|
|
1417
1398
|
|
|
1399
|
+
# Options of activer, desactiver, cluster and utiliser take their English names
|
|
1400
|
+
# (#557) : --context, --confirm, --yes ; the French ones warn (--oui included).
|
|
1401
|
+
case "${1:-}" in
|
|
1402
|
+
activer | desactiver | cluster | utiliser)
|
|
1403
|
+
if command -v canonical_args >/dev/null 2>&1; then
|
|
1404
|
+
canonical_args "$1" "${@:2}"
|
|
1405
|
+
set -- "$1" "${ARGS_CANONICAL[@]+"${ARGS_CANONICAL[@]}"}"
|
|
1406
|
+
fi
|
|
1407
|
+
;;
|
|
1408
|
+
esac
|
|
1409
|
+
|
|
1418
1410
|
case "${1:-}" in
|
|
1419
1411
|
"" | etat | modules) if [ "${2:-}" = "--json" ]; then etat_json; else etat; fi ;;
|
|
1420
1412
|
activer) changer on "${2:-}" "${@:3}" ;;
|
|
@@ -1454,7 +1446,7 @@ case "${1:-}" in
|
|
|
1454
1446
|
postgres) DEVZONE_ETAT="$ETAT" bash "$ICI/postgres/postgres.sh" "${@:2}" ;;
|
|
1455
1447
|
mysql) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue/mysql/mysql.sh" "${@:2}" ;;
|
|
1456
1448
|
gitlab) DEVZONE_ETAT="$ETAT" bash "$ICI/gitlab/gitlab.sh" "${@:2}" ;;
|
|
1457
|
-
catalogue) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue.sh"
|
|
1449
|
+
catalogue) DEVZONE_ETAT="$ETAT" bash "$ICI/catalogue.sh" list ;;
|
|
1458
1450
|
argocd) DEVZONE_ETAT="$ETAT" bash "$ICI/argocd/argocd.sh" "${@:2}" ;;
|
|
1459
1451
|
port) DEVZONE_ETAT="$ETAT" bash "$ICI/ports.sh" "${@:2}" ;;
|
|
1460
1452
|
paquets) bash "$ICI/paquets.sh" "${@:2}" ;;
|
|
@@ -1463,7 +1455,7 @@ case "${1:-}" in
|
|
|
1463
1455
|
echo "devzone : identifiants regroupés non mis à jour" >&2
|
|
1464
1456
|
bash "$ICI/password.sh" chemin
|
|
1465
1457
|
;;
|
|
1466
|
-
-h | --help | aide)
|
|
1458
|
+
-h | --help | aide) devzone_aide ;;
|
|
1467
1459
|
test-bash32) bash "$RACINE/manage/test/bash32.sh" ;;
|
|
1468
1460
|
test-gitlab) DEVZONE_ETAT="$ETAT" bash "$ICI/gitlab/test-gitlab.sh" "${@:2}" ;;
|
|
1469
1461
|
plateforme)
|