devzone 7.7.1 → 7.7.2

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/bin/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
- 58dee1dcd6ecaacb14501aaf29c9d636e4d92881364437a862e627c67371188c devzone-linux-amd64
2
- 499506206fd90ae3a66e46de4c554c08afd0cac219465ab61c3aedf58470f4ef devzone-linux-arm64
3
- d41a4bd2ed646431073aeda4cccd88e50a5e1f32fbf0a775bf37bb7005c4b734 devzone-darwin-amd64
4
- 272f7440e3fd40869c9bc471435fc63db4b33ccd23c21822a589ea66fe4cbcd5 devzone-darwin-arm64
5
- ed30a3cd296b1aa64f53f5f8f8ef0753daa026d5082663f01b448de226fc12fa devzone-windows-amd64.exe
6
- c68b53c4acde7e2da3f4f8271afa79285947b0890c0b25d058c5e8c7f63af505 devzone-windows-arm64.exe
1
+ 3e13b6e7151158b9cf45e7afa5b8b21e9c6db13d33a11661f8344de5030d8c9e devzone-linux-amd64
2
+ 7659bfe6ff140baaefe5f0508de398204762854eb46fa01382f20e2a9533120d devzone-linux-arm64
3
+ f2145f59ce7b2373384ac3c641ce5db1988693a44b0426511fec430f534b29c2 devzone-darwin-amd64
4
+ 4d4ed6287a2cabe792b1bf3906254427d80db1bc68bc4b4df8701afea71ca4f6 devzone-darwin-arm64
5
+ 8713509ad49fea935bd3890773382ba53ca64612c210d35d9e8304ba02df13d6 devzone-windows-amd64.exe
6
+ d6b60c60ac1562bc965cc6ed9aaa50799bd55a90b2f3c5cb2730f2890e65cb69 devzone-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/manage/devzone CHANGED
@@ -218,7 +218,9 @@ case "${1:-}" in
218
218
  "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" uninstall "${@:2}"
219
219
  ;;
220
220
  workspace)
221
- bash "$PAQUET/manage/workspace.sh" "${@:2}"
221
+ # The workspace is Go since #934: the bash entry point only forwards to
222
+ # the Go program, as update and uninstall do, so no logic stays here.
223
+ "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace "${@:2}"
222
224
  ;;
223
225
  -*)
224
226
  echo "✖ option inconnue : $1 (devzone --help)" >&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devzone",
3
- "version": "7.7.1",
3
+ "version": "7.7.2",
4
4
  "description": "Ton poste de développement Linux, prêt en une commande, identique sur Mac, Windows et Linux.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -31,7 +31,6 @@
31
31
  "manage/scripts/",
32
32
  "README.md",
33
33
  "LICENSE",
34
- "manage/workspace.sh",
35
34
  "charts/"
36
35
  ]
37
36
  }
@@ -1,169 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Workstation commands for the Kubernetes workspace (#398, #399): drives the
3
- # charts/devzone-workspace chart with host helm and kubectl.
4
- set -euo pipefail
5
-
6
- HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
- ROOT="$(cd "$HERE/.." && pwd)"
8
- # shellcheck disable=SC2034 # read by the argocd scripts and by .devcontainer/argocd/services.sh (shared with the pod)
9
- RACINE="$ROOT"
10
- # Pod, namespace and projects folder inside the container (#399).
11
- # shellcheck disable=SC2034 # read by the scripts sourced from scripts/workspace/
12
- POD="devzone-workspace-0"
13
- # shellcheck disable=SC2034 # read by the scripts sourced from scripts/workspace/
14
- NAMESPACE="devzone-workspace"
15
- PROJECTS_DIR="/workspaces/projets"
16
- # compatibility alias, removed with lot 4 (#509)
17
- # shellcheck disable=SC2034
18
- DOSSIER_PROJETS="$PROJECTS_DIR"
19
-
20
- # Helm flag: devzone context if it exists, otherwise current context (no flag).
21
- helm_flag() {
22
- if kubectl config get-contexts -o name 2>/dev/null | grep -qx 'devzone'; then
23
- printf -- '--kube-context devzone'
24
- fi
25
- }
26
-
27
- # kubectl flag: devzone context if it exists, otherwise current context (no flag).
28
- kubectl_flag() {
29
- if kubectl config get-contexts -o name 2>/dev/null | grep -qx 'devzone'; then
30
- printf -- '--context devzone'
31
- fi
32
- }
33
-
34
- # Chart path in the repository (or installed package).
35
- chart_path() { printf '%s/charts/devzone-workspace' "$ROOT"; }
36
-
37
- # Repository of the image published at each devzone release.
38
- IMAGE_REPO="ghcr.io/simbienvenuehoulboumi/devzone-workspace"
39
-
40
- # Why: without tag, the chart takes its appVersion (0.1.0), an image never
41
- # published; the package version is published at each release, and a
42
- # development clone (0.0.0) uses latest.
43
- default_image_tag() {
44
- local version
45
- version="$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$ROOT/package.json" | head -1)"
46
- if [ -z "$version" ] || [ "$version" = "0.0.0" ]; then
47
- echo "latest"
48
- else
49
- echo "$version"
50
- fi
51
- }
52
-
53
- # Installs or upgrades the workspace in the cluster; the cluster is checked first (#565): no Argo CD, helm or pod wait for a stopped one.
54
- start_workspace() {
55
- local repo tag image with_image="" args=()
56
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" kube-ready --hint >&2 || return 1
57
- repo="$IMAGE_REPO"
58
- tag="$(default_image_tag)"
59
- while [ $# -gt 0 ]; do
60
- case "$1" in
61
- --image)
62
- if [ $# -lt 2 ] || [ -z "$2" ]; then
63
- echo "✖ option --image: provide an image <repository:tag> (devzone workspace start --image <repository:tag>)" >&2
64
- return 1
65
- fi
66
- case "$2" in
67
- *:*)
68
- repo="${2%:*}"
69
- tag="${2##*:}"
70
- with_image=yes
71
- ;;
72
- *)
73
- echo "✖ option --image: image has no tag, expected <repository:tag> (devzone workspace start --image <repository:tag>)" >&2
74
- return 1
75
- ;;
76
- esac
77
- shift 2
78
- ;;
79
- *)
80
- echo "✖ unknown option: $1 (devzone workspace start [--image <repository:tag>])" >&2
81
- return 1
82
- ;;
83
- esac
84
- done
85
- image="$repo:$tag"
86
- # Argo CD first when wanted (#516): the workspace is then an Application
87
- if [ "$(grep '^argocd=' .devzone.modules 2>/dev/null | tail -1 | cut -d= -f2-)" != off ]; then
88
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace services enable argocd || echo "⚠ Argo CD not installed: the workspace is deployed with helm directly (devzone workspace services enable argocd to retry)" >&2
89
- fi
90
- rc=0
91
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace deploy "$repo" "$tag" "$with_image" || rc=$?
92
- if [ "$rc" -eq 3 ]; then
93
- workspace_helm_deploy "$repo" "$tag" "$with_image"
94
- elif [ "$rc" -ne 0 ]; then
95
- return "$rc"
96
- fi
97
- # Projects of .argocd.conf held too (#516)
98
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace argocd reconcile || true
99
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace wait "$image" || return 1
100
- "${DEVZONE_HOST_BIN:-false}" workspace agents-guard || true
101
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports start
102
- }
103
-
104
- # helm direct: the chart of the package, image set by the options
105
- workspace_helm_deploy() {
106
- local repo="$1" tag="$2" with_image="$3" args=()
107
- args=(--namespace devzone-workspace --create-namespace)
108
- [ -z "$with_image" ] || args+=(--set "image.repository=$repo")
109
- args+=(--set "image.tag=$tag")
110
- # latest moves at every release: an image already on the node would stay
111
- # the old one with IfNotPresent (#515)
112
- [ "$tag" != latest ] || args+=(--set "image.pullPolicy=Always")
113
- # egress proxy settings (#633), replayed at each start: commas escaped for helm
114
- for p in $("${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress params | sed 's/,/\\,/g'); do args+=(--set "$p"); done
115
- # shellcheck disable=SC2046
116
- helm $(helm_flag) upgrade --install devzone-workspace "$(chart_path)" "${args[@]}"
117
- }
118
-
119
- # Uninstalls the workspace from the cluster (Argo CD Application or helm release).
120
- stop_workspace() {
121
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports stop || true
122
- "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace stop
123
- }
124
-
125
- # Opens a shell in the workspace container.
126
- shell_workspace() {
127
- # shellcheck disable=SC2046
128
- kubectl $(kubectl_flag) exec -it devzone-workspace-0 --namespace devzone-workspace -c workspace -- bash
129
- }
130
-
131
-
132
- case "${1:-}" in
133
- start) start_workspace "${@:2}" ;;
134
- update) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace update "${@:2}" ;;
135
- stop) stop_workspace ;;
136
- status) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace status ;;
137
- shell) shell_workspace ;;
138
- ports) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace ports "${@:2}" ;;
139
- services) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace services "${@:2}" ;;
140
- argocd)
141
- sub="${2:-status}"
142
- case "$sub" in
143
- status) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace argocd status ;;
144
- init) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace argocd init "${@:3}" ;;
145
- apply) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace argocd apply ;;
146
- app) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace argocd app "${@:3}" ;;
147
- *)
148
- echo "✖ devzone workspace argocd status | init [--repo <url>|--none] | apply | app add <repo url> [path] [--name N] [--revision R] | app list | app remove <N>" >&2
149
- exit 1
150
- ;;
151
- esac
152
- ;;
153
- egress) "${DEVZONE_HOST_BIN:?devzone: Go program not found (DEVZONE_HOST_BIN), run it through manage/devzone}" workspace egress "${@:2}" ;;
154
- '' | -h | --help | help)
155
- echo "devzone workspace start|stop|status|shell|ports|services|argocd|update|egress"
156
- echo " start [--image repository:tag] install workspace (image for devzone version by default)"
157
- echo " update [--version X.Y.Z] [--yes] move to the latest stable release (or X.Y.Z); the pod is recreated"
158
- echo " ports [start|stop|status] applications and services from pod on workstation localhost"
159
- echo " services enable|disable <service> [options] | status"
160
- echo " devzone services (gitlab, postgres, argocd) of the cluster, installed from the workstation"
161
- echo " argocd status | init [--repo <url>|--none] | apply | app add <repo url> [path] [--name N] [--revision R] | app list | app remove <N>"
162
- echo " Argo CD of the workspace: .argocd.conf, GitOps repository, your projects as Applications"
163
- echo " egress observation|strict|off|status|allow <domain>|deny <domain> egress proxy of the agent sessions (--pod)"
164
- ;;
165
- *)
166
- echo "✖ unknown subcommand: $1 (devzone workspace start|stop|status|shell|ports|services|argocd|update)" >&2
167
- exit 1
168
- ;;
169
- esac