114 files into git, and the change detection I threw away
The SIM OTA data was a working directory on one server; putting it under version control took one commit, and the deploy path took two attempts.
The SIM over-the-air provisioning server keeps its configuration as files in a home directory — field definitions (fields.xml), binary payloads (bindata/), and the campaign scripts that drive a session (db/, smsscripts/). Nothing was in version control, so CW-1648 began by copying the lot in. One commit, 29 November 2024, 114 files and about 4.9 MB:
ota-data/simota/smsscripts/ 73 files (71 .script)
ota-data/simota/bindata/ 20 files (17 .dat, 2 .bin)
ota-data/simota/db/ 19 files (.txt campaign scripts)
ota-data/simota/fields.xml 1 file
That is the entire inventory, and it is worth stating because the size of the thing shapes everything after it. 4.9 MB of text and small binaries does not need a migration programme (no database, no schema, no cutover window). It needs a deploy path that is hard to get wrong.
The first deploy path, and why it went
The first attempt tried to be clever about change detection. A 70-line workflow stored the last deployed commit SHA in a GitHub Actions artifact (deployment-metadata, downloaded with continue-on-error: true), grepped Deployed Commit back out of it, then diffed each watched path against that SHA to build a CHANGED_FILES list for the deploy step.
It had three faults, and only one of them is interesting (the other two are typos with consequences):
echo "${WATCHED_FILES_FOLDERS}" | while IFS= read -r ITEM; do
...
CHANGED_FILES="$CHANGED_FILES $ITEM_CHANGES"
done
The loop is on the right of a pipe, so it runs in a subshell, and the assignment never leaves it. CHANGED_FILES is empty every time the loop ends. Below that, the deploy step ran make copy — a target the Makefile does not define (it has deploy-ota-files and dry-run-deploy-ota-files). And the watched paths still carried the pre-rename directory name, which the move to ota-data/simota/ had already invalidated (same ticket, same week). That branch never merged.
The second one names the files
What shipped instead stops trying to know what changed and lets rsync work it out:
SIMOTA_FILES = simota/fields.xml simota/bindata/ simota/db/ simota/smsscripts/
OTA_RSYNC = rsync -avz --progress --delete -e 'ssh -p 2222' \
--filter '-/ **/simota/db/*.bin' \
--filter '-/ **/simota/smsscripts/*-backup'
Four paths, one loop, no state carried between runs. The two --filter rules are the part that took the server to teach: it compiles each .txt campaign script into a .bin beside it, and keeps *-backup copies of the SMS scripts, so a --delete without those exclusions deletes artefacts the server made itself. The trailing slashes matter too (rsync treats db/ and db as different requests), which is why the variable carries a comment saying so.
dry-run-deploy-ota-files is the same target with EXTRA_RSYNC_ARGS="--dry-run", one line, and it is the only safe way to find out what a --delete is about to do. The default target directory was a scratch path under a test account, not the production one, so a mistake landed somewhere harmless. Colleagues corrected that four days later (three commits, 3 December 2024), along with the SSH authentication and the deploy user.
What it actually bought
Triggers came later: pull_request on main and workflow_dispatch, six lines, 6 February 2025. That is the whole of the automation — rsync over ssh to a gateway host on a non-standard port (2222), fired by a merge.
No legacy system was decommissioned, and the honest version says so. The OTA server is still the live system and git is a mirror of it; people still edit files on the server directly, and the repository now carries a second workflow that pulls those edits back and opens a branch for them (dozens of them by now, numbered in sequence). The deploy workflow has to check whether the server has drifted before it pushes, and skips that check when the commit it is deploying is itself a sync. The audit trail is real and it was the point. The single source of truth is still the server.