Two pipelines that tried to remember what they had done

A SIM provisioning pipeline and a documentation image, both of which got simpler once they stopped keeping state about their own past runs.

DevOps

SIM OTA data in git

The over-the-air data for our SIM estate lives on a vendor OTA platform, under one directory tree, and people edit it there through the platform's web interface. It is field definitions, the applet configuration tables and the SMS campaign scripts. In November 2024 that tree was imported into a repository so the server had a reviewed source (fields.xml, the db/ tables, bindata/ and smsscripts/), laid out exactly as on the server.

The first deployment design tried to be clever about which files to push. A workflow step downloaded a deployment-metadata artifact from the previous successful run, read the commit it recorded, and diffed each watched path against it:

echo "${WATCHED_FILES_FOLDERS}" | while IFS= read -r ITEM; do
  ITEM_CHANGES=$(git diff --name-only $LAST_DEPLOY_COMMIT HEAD -- "$ITEM")
  CHANGED_FILES="$CHANGED_FILES $ITEM_CHANGES"
done

That branch was never merged, and it should not have been. The while loop is the right-hand side of a pipe, so it runs in a subshell; CHANGED_FILES is empty again by the time the next step reads it. The artifact download was worse. It carried continue-on-error: true, so a missing or expired artifact (they expire in 90 days by default) left LAST_DEPLOY_COMMIT unset — which the script reads as "no previous deployment", and therefore as "deploy everything". The failure mode of the safety mechanism was a full overwrite.

What landed instead has no memory at all. The workflow's own paths: filter decides whether to run, and the Makefile holds the list explicitly:

SIMOTA_FILES = \
        simota/fields.xml \
        simota/bindata/ \
        simota/db/ \
        simota/smsscripts/

deploy-ota-files:
        @for item in $(SIMOTA_FILES); do \
                $(OTA_RSYNC_COMMAND) $(EXTRA_RSYNC_ARGS) "$$item" \
                        "$(SSH_TARGET):$(SIMOTA_HOME)/$$item"; \
        done

dry-run-deploy-ota-files:
        $(MAKE) deploy-ota-files EXTRA_RSYNC_ARGS="--dry-run"

One rsync per listed item, and one filter excluding the platform's own bytecode caches and automatic backups. The dry run is the same target with one argument added (--dry-run), so what it reports is what the real run will do. A new file is deployed because it sits in the tree under a listed path — and only for that reason.

The harder half of that problem was built a year later by a colleague, on top of these targets: detect that the server holds changes the repository lacks, and open a pull request with the server's version before any deployment may proceed. Two-way sync with a web interface is a different problem from deployment (the GUI is a second author, and it never opens a PR), and it deserved its own workflow.

The documentation image, and what the old agent was hiding

The EPC repository publishes an architecture and runbook site — mkdocs, diagrams rendered through a local service, the result baked into a container. In February 2026 its four-line Jenkinsfile became a fifteen-line workflow calling the shared image build. The migration looked finished.

Three more commits landed the same day, all in the Makefile, and between them they fixed four things:

  • python3 -m venv .env failed on the runner, because the Jenkins agent had the venv package and the runner did not.
  • The package name needed pinning to the runner's interpreter (python3.12-venv, not the generic python3-venv).
  • Installing it needed sudo, and the install was then made non-fatal (|| true) so a host that already has it still builds.
  • pip install -r requirements.txt became .env/bin/pip, since the system pip was no longer the one inside the virtual environment.

None of those four is interesting on its own. Together they are the real cost of a CI migration. The pipeline file is mechanical; every assumption the old agent satisfied silently has to be found by failing, one commit at a time.