A build definition says when it runs in a trigger block of its own
`onPush`, `atTimes`, `branches`, and `activeWithin` move into a nested `trigger`. The split is structural on purpose: the inheritance from `builds.default` now subtracts one key instead of a list of four, so a selector added to `TriggerConfig` later is non-inheritable by construction rather than because someone remembered to extend the list. A definition still writing those keys flat is refused by name, per file and scoped like the version check — the machine and project config abort the start, a branch's committed config fails only that branch. Ignoring them would leave the build with no trigger at all, which is a job that quietly stops running: the failure this refusal exists to prevent. Two more things a definition can now say: - A `!` prefix in `trigger.branches` excludes, and an exclusion wins whatever the order. `["*", "!master"]` gives one branch a build of its own without the default build running over it as well — until now the only way out of that double build was to drop the second definition's push trigger. - `statusContext` overrides the Gitea check this build reports as, empty keeping the repository-wide one. Two builds of a commit shared a context and overwrote each other's result, so a quick check beside a long build was not readable in Gitea. Pinned like `requirePullRequest`: a branch that could pick its context could take over the check a branch protection rule depends on. Fixed on the way: a branch whose builds all belong to named definitions rendered an empty row in the branches view, reading as "never built" directly beside its real builds. That row was unreachable before the exclusion patterns made such a branch possible.
This commit is contained in:
@@ -182,7 +182,13 @@ class InitCommand(
|
||||
# they apply to that branch alone, so a new job can be tried out on one branch.
|
||||
builds:
|
||||
default:
|
||||
onPush: true # build every new commit of the selected branches
|
||||
# When this build runs and for which branches. The only part a build does
|
||||
# NOT inherit from the default — everything below it does.
|
||||
trigger:
|
||||
onPush: true # build every new commit of the selected branches
|
||||
# branches: ["*", "!master"] # names or globs; "!" excludes; default: all
|
||||
# atTimes: ["01:00"] # daily UTC times HH:MM ("??:05" = every hour at :05)
|
||||
# activeWithin: 24h # only branches with recent commits
|
||||
# run before each build
|
||||
cleanCommand: rm -rf build
|
||||
# shell command for each build
|
||||
@@ -203,12 +209,16 @@ class InitCommand(
|
||||
context: "." # Docker build context used with dockerfile
|
||||
network: "" # Docker network mode for the build container; empty = Docker default (pinned)
|
||||
env: {} # additional environment variables set inside the build container
|
||||
# Further jobs inherit those settings and add their own trigger and selector:
|
||||
# Gitea check this build reports as; empty uses gitea.statusContext.
|
||||
# Two builds of one commit under the same context overwrite each other.
|
||||
statusContext: ""
|
||||
# Further jobs inherit those settings and only bring their own trigger:
|
||||
# pitest:
|
||||
# atTimes: ["01:00"] # daily UTC times HH:MM ("??:05" = every hour at :05)
|
||||
# branches: ["master"] # names or glob patterns; default: all branches
|
||||
# activeWithin: 24h # only branches with recent commits
|
||||
# trigger:
|
||||
# atTimes: ["01:00"]
|
||||
# branches: ["master"]
|
||||
# buildCommand: ./gradlew pitestFull
|
||||
# statusContext: GitTally/pitest
|
||||
|
||||
# Build artifact storage and retention.
|
||||
artifacts:
|
||||
|
||||
Reference in New Issue
Block a user