12 Commits
v9 ... v15
Author SHA1 Message Date
renovate-bot ab177ecb46 Merge pull request 'Update Node.js to e6bedef' (#10) from renovate/ci-actions into main
tag / tag (push) Successful in 7s
2026-11-11 21:58:36 +01:00
renovate-bot c0d6ecf9f6 Update Node.js to e6bedef
pr-check / docker (pull_request) Successful in 30s
pr-check / binary (pull_request) Successful in 1m41s
2026-11-11 20:56:50 +00:00
renovate-bot 979335fe31 Merge pull request 'Update trivy to v0.76.2' (#9) from renovate/trivy into main
tag / tag (push) Successful in 4s
2026-11-05 14:00:01 +01:00
renovate-bot 6ee8b2da6a Merge pull request 'Update Node.js to ed67041' (#8) from renovate/ci-actions into main
tag / tag (push) Successful in 5s
2026-11-05 13:58:49 +01:00
renovate-bot 26468ba73d Update trivy to v0.76.2
pr-check / docker (pull_request) Successful in 16s
pr-check / binary (pull_request) Successful in 56s
2026-11-05 12:55:58 +00:00
renovate-bot b90b98bafb Update Node.js to 5adad64
pr-check / docker (pull_request) Successful in 12s
pr-check / binary (pull_request) Successful in 58s
2026-11-05 12:55:52 +00:00
tth 7c8359099c Merge pull request 'portainer-deploy: wait for the Swarm rollout before the smoke check (v12)' (#7) from agent/dart/portainer-wait-rollout into main
tag / tag (push) Skipped
2026-11-03 01:55:02 +01:00
tthandClaude Opus 5.5 94d0ba6b78 portainer-deploy: wait for the Swarm rollout before the smoke check (v12)
pr-check / docker (pull_request) Successful in 10s
pr-check / binary (pull_request) Successful in 1m14s
The smoke URL answered from the old task right after the stack PUT, so CI
went green before anything was deployed (birdnet-go 2026-11-03: green, then
1 min of 503) and a paused update stayed unnoticed (revaj-crm-stage
2026-11-02, new image exited 1 twice, CI green). Now the step waits until
every service whose UpdateStatus.StartedAt changed is completed and fails
on paused / rollback_*; untouched services are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:40:24 +01:00
renovate-bot 52fab24049 Merge pull request 'Update Node.js to e4db4c9' (#6) from renovate/ci-actions into main
tag / tag (push) Successful in 5s
2026-10-29 01:52:40 +01:00
renovate-bot 1d363f0eac Update Node.js to e4db4c9
pr-check / docker (pull_request) Successful in 11s
pr-check / binary (pull_request) Successful in 58s
2026-10-29 00:51:27 +00:00
renovate-bot dfe768f871 Merge pull request 'Update Node.js to 9481667' (#5) from renovate/ci-actions into main
tag / tag (push) Successful in 4s
2026-10-28 07:57:13 +01:00
renovate-bot fc400e752d Update Node.js to 9481667
pr-check / docker (pull_request) Successful in 9s
pr-check / binary (pull_request) Successful in 54s
2026-10-28 06:56:14 +00:00
5 changed files with 88 additions and 9 deletions

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# No Docker CLI here, so trivy-gate falls back to the pinned binary. # No Docker CLI here, so trivy-gate falls back to the pinned binary.
container: container:
image: node:26-trixie-slim@sha256:36793bcbb160a6a16cede1e62b93f84e26b78a972a8a4c0b879c1c12f22761ec image: node:26-trixie-slim@sha256:e6bedef217677b276c591795e169840edd9096dbf13f29df8ef8d1856b8820bc
steps: steps:
- name: Tools the actions expect - name: Tools the actions expect
run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ca-certificates curl git jq >/dev/null run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ca-certificates curl git jq >/dev/null
+10 -1
View File
@@ -106,6 +106,10 @@ binary is verified by SHA-256.
(dispatch/cron runs scanned the whole tree as a root commit before). (dispatch/cron runs scanned the whole tree as a root commit before).
`v8` dtrack-sbom really never fails the job: the runner's `bash -e` turned `v8` dtrack-sbom really never fails the job: the runner's `bash -e` turned
an unreachable Dependency-Track into a failed build instead of a warning. an unreachable Dependency-Track into a failed build instead of a warning.
`v12` portainer-deploy waits for the Swarm rollout before the smoke check
and fails on a paused or rolled-back update: the smoke URL used to answer
from the old task, so a new image that never started still gave a green
deploy.
Pinned tools (Trivy binary + image, gitleaks) are bumped by Renovate Pinned tools (Trivy binary + image, gitleaks) are bumped by Renovate
(tth/renovate). Its post-upgrade task `.gitea/update-checksums.sh` (tth/renovate). Its post-upgrade task `.gitea/update-checksums.sh`
@@ -122,7 +126,11 @@ last step of the build → `trivy-gate` → move `latest` → deploy pipeline. T
compose file in git is the single source of truth: Portainer's stored compose file in git is the single source of truth: Portainer's stored
compose is replaced on every deploy. The stack's env vars (where the secrets compose is replaced on every deploy. The stack's env vars (where the secrets
live) are kept and never logged; only `vars` are overwritten. Images are live) are kept and never logged; only `vars` are overwritten. Images are
re-pulled (`pullImage`). re-pulled (`pullImage`). The step then waits until every service the deploy
changed has finished its Swarm update (`wait-rollout`, `rollout-timeout`,
default 600 s incl. image pulls) and fails when the update is paused or
rolled back; only then is `smoke-url` checked. Services the deploy did not
touch are ignored, even when an older update of theirs is still paused.
```yaml ```yaml
- uses: https://git.rfa.cz/tth-pub/ci-actions/portainer-deploy@v5 - uses: https://git.rfa.cz/tth-pub/ci-actions/portainer-deploy@v5
@@ -136,6 +144,7 @@ re-pulled (`pullImage`).
smoke-url: https://app.example.org/health # optional smoke-url: https://app.example.org/health # optional
smoke-status: "200" smoke-status: "200"
smoke-timeout: "180" smoke-timeout: "180"
rollout-timeout: "600" # optional; wait-rollout: "false" = old behaviour
``` ```
Config files from the repo can ride along as Swarm configs. Each becomes a Config files from the repo can ride along as Swarm configs. Each becomes a
+1 -1
View File
@@ -32,7 +32,7 @@ inputs:
default: "5" default: "5"
trivy-image: trivy-image:
description: Trivy container image, pinned by digest. description: Trivy container image, pinned by digest.
default: aquasec/trivy:0.76.1@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c default: aquasec/trivy:0.76.2@sha256:8f6bb947dbc528902e11f2f5be52f7b519f6a39d5d148f41166f2040499768fb
runs: runs:
using: composite using: composite
+72 -2
View File
@@ -5,7 +5,9 @@ description: >
replaced on every deploy, the stack's env vars (where the secrets live) are replaced on every deploy, the stack's env vars (where the secrets live) are
kept and only the given variables are overwritten. Images are re-pulled. kept and only the given variables are overwritten. Images are re-pulled.
Config files from the repo can be shipped as content-addressed Swarm Config files from the repo can be shipped as content-addressed Swarm
configs. Optionally waits until a URL answers with the expected status. configs. Waits until Swarm has finished rolling out the services the
deploy changed (a paused or rolled-back update fails the step), then
optionally until a URL answers with the expected status.
inputs: inputs:
url: url:
@@ -46,8 +48,19 @@ inputs:
prune: prune:
description: Remove services that are no longer in the compose file. description: Remove services that are no longer in the compose file.
default: "false" default: "false"
wait-rollout:
description: >
Wait until every service this deploy changed has finished its Swarm
update; fail when the update is paused or rolled back. "false" = return
right after the stack update (the old behaviour).
default: "true"
rollout-timeout:
description: Seconds to wait for the rollout (image pulls included).
default: "600"
smoke-url: smoke-url:
description: URL polled after the deploy until it answers smoke-status. Empty = no check. description: >
URL polled after the rollout until it answers smoke-status. Empty = no
check.
default: "" default: ""
smoke-status: smoke-status:
description: Expected HTTP status of smoke-url. description: Expected HTTP status of smoke-url.
@@ -70,6 +83,8 @@ runs:
CONFIGS: ${{ inputs.configs }} CONFIGS: ${{ inputs.configs }}
CONFIG_PREFIX: ${{ inputs.config-prefix }} CONFIG_PREFIX: ${{ inputs.config-prefix }}
PRUNE: ${{ inputs.prune }} PRUNE: ${{ inputs.prune }}
WAIT_ROLLOUT: ${{ inputs.wait-rollout }}
ROLLOUT_TIMEOUT: ${{ inputs.rollout-timeout }}
SMOKE_URL: ${{ inputs.smoke-url }} SMOKE_URL: ${{ inputs.smoke-url }}
SMOKE_STATUS: ${{ inputs.smoke-status }} SMOKE_STATUS: ${{ inputs.smoke-status }}
SMOKE_TIMEOUT: ${{ inputs.smoke-timeout }} SMOKE_TIMEOUT: ${{ inputs.smoke-timeout }}
@@ -145,6 +160,24 @@ runs:
sets[var] = name sets[var] = name
_, stack = api("GET", f"/api/stacks/{stack_id}") _, stack = api("GET", f"/api/stacks/{stack_id}")
# Rollout: remember each service's last update start before the
# PUT; afterwards only the services whose update start changed are
# this deploy's. Comparing with the previous value, not with the
# clock, keeps runner/Swarm clock skew out of it. Without this the
# smoke check below answered from the OLD task (birdnet-go
# 2026-11-03: green CI, then 1 min of 503) and a paused update
# went unnoticed (revaj-crm-stage 2026-11-02).
wait = E.get("WAIT_ROLLOUT", "true").lower() == "true"
sflt = urllib.parse.quote(json.dumps(
{"label": [f"com.docker.stack.namespace={stack.get('Name', '')}"]}))
def services():
_, out = api("GET", f"{docker}/services?filters={sflt}")
return {s["ID"]: s for s in out or []}
before = {i: (s.get("UpdateStatus") or {}).get("StartedAt")
for i, s in services().items()} if wait else {}
env = [e for e in (stack.get("Env") or []) if e.get("name") not in sets] env = [e for e in (stack.get("Env") or []) if e.get("name") not in sets]
kept = len(env) kept = len(env)
env += [{"name": k, "value": v} for k, v in sets.items()] env += [{"name": k, "value": v} for k, v in sets.items()]
@@ -159,6 +192,43 @@ runs:
shown = ", ".join(f"{k}={v}" for k, v in sets.items()) or "nothing" shown = ", ".join(f"{k}={v}" for k, v in sets.items()) or "nothing"
print(f"stack {stack.get('Name', stack_id)} updated from {E['COMPOSE_FILE']}: {shown}; {kept} other variable(s) kept") print(f"stack {stack.get('Name', stack_id)} updated from {E['COMPOSE_FILE']}: {shown}; {kept} other variable(s) kept")
if wait:
rollout_timeout = float(E.get("ROLLOUT_TIMEOUT") or 600)
start = time.time()
deadline, grace, shown_at = start + rollout_timeout, start + 20, 0.0
while True:
pending, failed, done = [], [], []
for i, s in services().items():
u = s.get("UpdateStatus") or {}
if not u or (i in before and u.get("StartedAt") == before[i]):
continue # untouched by this deploy, or newly created
name, state = s["Spec"]["Name"], u.get("State", "")
if state == "completed":
done.append(name)
elif state == "updating":
pending.append(name)
else: # paused, rollback_started / _paused / _completed
failed.append(f"{name}: {state} ({u.get('Message', '')})")
if failed:
raise RuntimeError("rollout failed - " + "; ".join(failed))
if pending:
if time.time() >= deadline:
raise RuntimeError(f"rollout not finished after {rollout_timeout:.0f} s: {', '.join(pending)}")
if time.time() - shown_at >= 30:
print(f"rollout: waiting for {', '.join(pending)}", flush=True)
shown_at = time.time()
elif done:
print(f"rollout: completed in {time.time() - start:.0f} s: {', '.join(done)}")
break
elif time.time() >= grace:
# The PUT can return before Swarm registers the update
# (birdnet-go: PUT logged 00:29:25.908, update started
# 25.929), hence the grace. Nothing after it = same
# image digest and configs, Swarm had nothing to update.
print("rollout: no service was updated by this deploy")
break
time.sleep(5)
# Older versions go once nothing mounts them; Docker refuses to # Older versions go once nothing mounts them; Docker refuses to
# delete a config in use (the previous task may still be draining), # delete a config in use (the previous task may still be draining),
# the next deploy retries. # the next deploy retries.
+4 -4
View File
@@ -50,7 +50,7 @@ inputs:
default: "false" default: "false"
trivy-image: trivy-image:
description: Trivy container image, pinned by digest. description: Trivy container image, pinned by digest.
default: aquasec/trivy:0.76.1@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c default: aquasec/trivy:0.76.2@sha256:8f6bb947dbc528902e11f2f5be52f7b519f6a39d5d148f41166f2040499768fb
cache-volume: cache-volume:
description: > description: >
Docker named volume for the vulnerability DB. A named volume, not a Docker named volume for the vulnerability DB. A named volume, not a
@@ -77,9 +77,9 @@ runs:
SCAN_REF: ${{ inputs.scan-ref }} SCAN_REF: ${{ inputs.scan-ref }}
RUNTIME: ${{ inputs.runtime }} RUNTIME: ${{ inputs.runtime }}
SCANNERS: ${{ inputs.scanners }} SCANNERS: ${{ inputs.scanners }}
TRIVY_VERSION: "0.76.1" TRIVY_VERSION: "0.76.2"
TRIVY_SHA256_AMD64: c7cbe3137fb8a48a17574bede3dd6beb16742d1e9772929940fc90082c39d9c0 TRIVY_SHA256_AMD64: bc0fc726e017b8927a62b2d3531d7a84ee01769daf5c99ed866dced54089fdbf
TRIVY_SHA256_ARM64: e174dff2a6dba5e3ae41f8d0537a6324405bd08132497340304c6b20e0f16a1f TRIVY_SHA256_ARM64: ab9d51f86e6a5fb936f605faff6b593ac51bc378fff4d3e8b9d58358b9c367c3
TRIVY_USERNAME: ${{ inputs.username }} TRIVY_USERNAME: ${{ inputs.username }}
TRIVY_PASSWORD: ${{ inputs.password }} TRIVY_PASSWORD: ${{ inputs.password }}
PLATFORM: ${{ inputs.platform }} PLATFORM: ${{ inputs.platform }}