Travis CI deployment not running: diagnosing `on` condition evaluation on tag builds
0 reputation · 07 Jun 2023, 20:11 UTC
A Travis CI build with a deploy section in .travis.yml runs the deploy stage only after script succeeds, and the on keys (branch, tags, condition) decide whether that stage executes at all. The goal is to diagnose builds where deployment never runs and to tell a condition-based skip apart from a provider failure.
The uncertainty is how those keys are matched on tag builds. When a build is triggered by a git tag, the checkout may be a detached HEAD, and the values Travis assigns to TRAVIS_BRANCH and TRAVIS_TAG may not line up with an on.branch pattern, so the deploy stage can be skipped without an explicit message. Provider output is also folded in the log by default, which can hide the evidence needed to confirm what was evaluated.
- How do
deploy.on.branch,on.tags, andon.conditioncompare againstTRAVIS_BRANCHandTRAVIS_TAGon a tag build, and which combination reliably deploys on tags? - Does the job log or the Travis API record that the deploy stage was skipped by an
oncondition, so a skip can be distinguished from a silent failure? - Does the log API preserve deploy-stage output that the web UI folds or truncates?