Skip to content

Commit 509d195

Browse files
committed
Add branch:tag override syntax in branches.yaml
Lets a build pull from one branch but publish under a different docker tag, e.g. `prototype/focil:focil` builds the prototype/focil branch and tags it `focil`. Replaces the previously unused `@` separator with `:`, which reads more naturally and frees `@` for future commit-pinning use. Applied to teku focil so it tracks consensys/teku@prototype/focil instead of the nonexistent `focil` branch (which is why scheduled builds for focil were failing).
1 parent f838d8c commit 509d195

3 files changed

Lines changed: 28 additions & 7 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ Add a new image to [`config.yaml`](./config.yaml) file and it will be built on s
5555
dockerfile: ./lighthouse/Dockerfile # optional docker file to use, defaults to the source repository's Dockerfile
5656
```
5757
58+
## `branches.yaml` syntax
59+
60+
`config.yaml` is generated from `branches.yaml` by `generate_config.py`. Each client lists branches that should be built; the branch name is used directly as the docker tag (slashes become hyphens).
61+
62+
To build from one branch but publish under a different tag, use `<branch>:<tag>`:
63+
64+
```yaml
65+
teku:
66+
branches:
67+
- master
68+
- prototype/focil:focil # builds prototype/focil, publishes as :focil
69+
```
70+
71+
The same syntax works inside `alt_repos` entries (the alt-repo prefix is still prepended to the override tag).
72+
73+
After editing `branches.yaml`, run `python3 generate_config.py` to regenerate `config.yaml`.
74+
5875
## Per-tag Dockerfile convention
5976

6077
When a build needs a different Dockerfile than the default (e.g. an alt-fork branch that doesn't work with the upstream one), drop it in alongside the default using the naming convention:

branches.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# Default upstream repository is assumed for each client
44
# Branch names are used directly as tags unless in alt_repos
5+
#
6+
# Tag override: use "<branch>:<tag>" to build from <branch> but publish as <tag>.
7+
# Example: "prototype/focil:focil" builds the prototype/focil branch and tags it "focil".
8+
# Without an override, slashes in branch names are replaced with hyphens for the tag.
59

610
besu:
711
branches:
@@ -122,7 +126,7 @@ teku:
122126
- optional-proofs
123127
- glamsterdam-devnet-0
124128
- glamsterdam-devnet-2
125-
- focil
129+
- prototype/focil:focil
126130

127131
eleel:
128132
branches:

generate_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def generate_config():
113113
# Process main branches
114114
if 'branches' in client_config:
115115
for branch_spec in client_config['branches']:
116-
# Check if this is a branch with special tag
117-
if '@' in branch_spec:
118-
branch, special_tag = branch_spec.split('@', 1)
116+
# Check if this is a branch with a tag override (e.g. "prototype/focil:focil")
117+
if ':' in branch_spec:
118+
branch, special_tag = branch_spec.split(':', 1)
119119
process_branch(client_name, default_repo, branch, special_tag, config_list)
120120
else:
121121
# Regular branch
@@ -153,9 +153,9 @@ def generate_config():
153153
prefix = repo_parts[0].lower()
154154

155155
for branch_spec in branches:
156-
# Check if this is a branch with special tag
157-
if '@' in branch_spec:
158-
branch, special_tag = branch_spec.split('@', 1)
156+
# Check if this is a branch with a tag override (e.g. "prototype/focil:focil")
157+
if ':' in branch_spec:
158+
branch, special_tag = branch_spec.split(':', 1)
159159
# Create the target tag with prefix and special tag
160160
target_tag = f"{prefix}-{special_tag}"
161161
process_branch(client_name, alt_repo, branch, target_tag, config_list)

0 commit comments

Comments
 (0)