deploy.sh starts the containers (Starting containers..., up -d --force-recreate) before it records NETORK_VERSION in ~/netork/.env (Recording registry settings...). The services read that file through env_file: .env, so every container starts with the version of the previous deploy in its environment.
Seen
A host ran a feature tag, then deploy.sh deployed latest-dev. The containers ran the latest-dev image as they should (the image tag comes from the exported variable, not from .env), but docker exec <api> env showed NETORK_VERSION=feature-container-engine-api, which was the tag before. .env itself said latest-dev afterwards.
Impact
Low. netOrk does not read NETORK_VERSION at runtime; the image tag is right. But anybody who checks a container's environment to see what runs is told something wrong, and that happens precisely while debugging a deploy. The next deploy only shifts the error by one.
Fix
Record the settings in .env before the first up -d, or pass the same values to the containers some other way. The comment above the recording step explains why .env must hold them (a hand-typed docker compose up -d <service> on the host); moving the step earlier keeps that.
Test-First
A test that checks the recording step comes before the first up -d in the script, or a dry run asserting the order of the remote commands.
`deploy.sh` starts the containers (`Starting containers...`, `up -d --force-recreate`) **before** it records `NETORK_VERSION` in `~/netork/.env` (`Recording registry settings...`). The services read that file through `env_file: .env`, so every container starts with the version of the **previous** deploy in its environment.
## Seen
A host ran a feature tag, then `deploy.sh` deployed `latest-dev`. The containers ran the `latest-dev` image as they should (the image tag comes from the exported variable, not from `.env`), but `docker exec <api> env` showed `NETORK_VERSION=feature-container-engine-api`, which was the tag before. `.env` itself said `latest-dev` afterwards.
## Impact
Low. netOrk does not read `NETORK_VERSION` at runtime; the image tag is right. But anybody who checks a container's environment to see what runs is told something wrong, and that happens precisely while debugging a deploy. The next deploy only shifts the error by one.
## Fix
Record the settings in `.env` before the first `up -d`, or pass the same values to the containers some other way. The comment above the recording step explains why `.env` must hold them (a hand-typed `docker compose up -d <service>` on the host); moving the step earlier keeps that.
## Test-First
A test that checks the recording step comes before the first `up -d` in the script, or a dry run asserting the order of the remote commands.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
deploy.shstarts the containers (Starting containers...,up -d --force-recreate) before it recordsNETORK_VERSIONin~/netork/.env(Recording registry settings...). The services read that file throughenv_file: .env, so every container starts with the version of the previous deploy in its environment.Seen
A host ran a feature tag, then
deploy.shdeployedlatest-dev. The containers ran thelatest-devimage as they should (the image tag comes from the exported variable, not from.env), butdocker exec <api> envshowedNETORK_VERSION=feature-container-engine-api, which was the tag before..envitself saidlatest-devafterwards.Impact
Low. netOrk does not read
NETORK_VERSIONat runtime; the image tag is right. But anybody who checks a container's environment to see what runs is told something wrong, and that happens precisely while debugging a deploy. The next deploy only shifts the error by one.Fix
Record the settings in
.envbefore the firstup -d, or pass the same values to the containers some other way. The comment above the recording step explains why.envmust hold them (a hand-typeddocker compose up -d <service>on the host); moving the step earlier keeps that.Test-First
A test that checks the recording step comes before the first
up -din the script, or a dry run asserting the order of the remote commands.