dashboard: content-hash image tag so stack deploy rolls on code change (not stuck on :latest)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -10,9 +10,15 @@ let
|
|||||||
cp ${../dashboard/dashboard.py} $out/app/dashboard.py
|
cp ${../dashboard/dashboard.py} $out/app/dashboard.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Content-derived tag: changes whenever dashboard.py changes, so `docker stack deploy` actually
|
||||||
|
# rolls the service to the new image (a fixed `:latest` tag + unchanged stack spec does NOT roll —
|
||||||
|
# swarm sees no change). Reproducible + self-healing.
|
||||||
|
imageTag = builtins.substring 0 12 (builtins.hashString "sha256"
|
||||||
|
(builtins.readFile ../dashboard/dashboard.py));
|
||||||
|
|
||||||
image = pkgs.dockerTools.buildLayeredImage {
|
image = pkgs.dockerTools.buildLayeredImage {
|
||||||
name = "cc-ci-dashboard";
|
name = "cc-ci-dashboard";
|
||||||
tag = "latest";
|
tag = imageTag;
|
||||||
contents = [ pkgs.python3 pkgs.cacert dashApp ];
|
contents = [ pkgs.python3 pkgs.cacert dashApp ];
|
||||||
config = {
|
config = {
|
||||||
Cmd = [ "${pkgs.python3}/bin/python3" "/app/dashboard.py" ];
|
Cmd = [ "${pkgs.python3}/bin/python3" "/app/dashboard.py" ];
|
||||||
@ -25,7 +31,7 @@ let
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: cc-ci-dashboard:latest
|
image: cc-ci-dashboard:${imageTag}
|
||||||
environment:
|
environment:
|
||||||
- DRONE_URL=https://drone.ci.commoninternet.net
|
- DRONE_URL=https://drone.ci.commoninternet.net
|
||||||
- CI_REPO=recipe-maintainers/cc-ci
|
- CI_REPO=recipe-maintainers/cc-ci
|
||||||
|
|||||||
Reference in New Issue
Block a user