Compare commits

...

2 Commits

Author SHA1 Message Date
Sergey Antropoff 98ba5004ad Fix Deploy stage for Alpine ash: drop bash arrays.
Jenkins docker agents run sh without array syntax; set simulator/migrate images with POSIX conditionals.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 02:12:16 +03:00
Sergey Antropoff c64cd4ca8b Raise deploy rollout timeout to 1200s and set images in one step.
Avoid double ReplicaSet churn and ImagePullBackOff races during Hub pulls.
2026-07-28 00:56:46 +03:00
3 changed files with 15 additions and 11 deletions
Vendored
+11 -9
View File
@@ -135,7 +135,7 @@ pipeline {
chmod +x /usr/local/bin/kubectl chmod +x /usr/local/bin/kubectl
fi fi
kubectl version --client --short || kubectl version --client kubectl version --client || true
if ! kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" >/dev/null 2>&1; then if ! kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" >/dev/null 2>&1; then
echo "Deployment ${HELM_NAMESPACE}/${DEPLOYMENT_NAME} not found." >&2 echo "Deployment ${HELM_NAMESPACE}/${DEPLOYMENT_NAME} not found." >&2
@@ -146,20 +146,22 @@ pipeline {
echo "Rolling ${DOCKERHUB_IMAGE}:${IMAGE_VERSION} → ${HELM_NAMESPACE}/${DEPLOYMENT_NAME}" echo "Rolling ${DOCKERHUB_IMAGE}:${IMAGE_VERSION} → ${HELM_NAMESPACE}/${DEPLOYMENT_NAME}"
echo "Public URL: https://${INGRESS_HOST}/" echo "Public URL: https://${INGRESS_HOST}/"
# Main container always; migrate initContainer when present. # POSIX sh (Alpine ash): no bash arrays. One set-image when migrate exists.
INITS="$(kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" \
-o jsonpath='{.spec.template.spec.initContainers[*].name}' || true)"
if printf '%s\n' $INITS | grep -qx migrate; then
kubectl -n "$HELM_NAMESPACE" set image \
"deployment/${DEPLOYMENT_NAME}" \
"simulator=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}" \
"migrate=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}"
else
kubectl -n "$HELM_NAMESPACE" set image \ kubectl -n "$HELM_NAMESPACE" set image \
"deployment/${DEPLOYMENT_NAME}" \ "deployment/${DEPLOYMENT_NAME}" \
"simulator=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}" "simulator=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}"
if kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" \
-o jsonpath='{.spec.template.spec.initContainers[*].name}' \
| tr ' ' '\n' | grep -qx migrate; then
kubectl -n "$HELM_NAMESPACE" set image \
"deployment/${DEPLOYMENT_NAME}" \
"migrate=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}"
fi fi
kubectl -n "$HELM_NAMESPACE" rollout status \ kubectl -n "$HELM_NAMESPACE" rollout status \
"deployment/${DEPLOYMENT_NAME}" --timeout=300s "deployment/${DEPLOYMENT_NAME}" --timeout=1200s
kubectl -n "$HELM_NAMESPACE" get deploy,po,ing -o wide kubectl -n "$HELM_NAMESPACE" get deploy,po,ing -o wide
''' '''
} }
+2 -1
View File
@@ -15,7 +15,8 @@ Single [`Jenkinsfile`](../Jenkinsfile) on `main` / `master`:
1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64` 1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64`
to Harbor and Docker Hub with tags **`:{VERSION}`** and **`:latest`** only. to Harbor and Docker Hub with tags **`:{VERSION}`** and **`:latest`** only.
2. **Deploy**`kubectl set image` on `simulators/simulators-proxmox` (main 2. **Deploy**`kubectl set image` on `simulators/simulators-proxmox` (main
container `simulator` + initContainer `migrate`), then rollout status. container `simulator` + initContainer `migrate`), then rollout status
(`--timeout=1200s`).
First cluster install (Ingress, Postgres, secrets) is **not** this job — use First cluster install (Ingress, Postgres, secrets) is **not** this job — use
`make addon-simulators` in DevOpsTools/K3S (`simulators_proxmox_host: `make addon-simulators` in DevOpsTools/K3S (`simulators_proxmox_host:
+2 -1
View File
@@ -15,7 +15,8 @@ Jenkins версию **не** поднимает — собирает то, чт
1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64` 1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64`
в Harbor и Docker Hub, теги только **`:{VERSION}`** и **`:latest`**. в Harbor и Docker Hub, теги только **`:{VERSION}`** и **`:latest`**.
2. **Deploy**`kubectl set image` для `simulators/simulators-proxmox` 2. **Deploy**`kubectl set image` для `simulators/simulators-proxmox`
(контейнер `simulator` + initContainer `migrate`), затем rollout status. (контейнер `simulator` + initContainer `migrate`), затем rollout status
(`--timeout=1200s`).
Первый install в кластере (Ingress, Postgres, секреты) — **не** этот job, а Первый install в кластере (Ingress, Postgres, секреты) — **не** этот job, а
`make addon-simulators` в DevOpsTools/K3S (`simulators_proxmox_host: `make addon-simulators` в DevOpsTools/K3S (`simulators_proxmox_host: