Skip to content

Commit ae5d228

Browse files
dfarrell07tpantelis
authored andcommitted
Add agent-executable docs for Konflux setup
Signed-off-by: Daniel Farrell <[email protected]>
1 parent 3f90f69 commit ae5d228

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#### Setting up Lighthouse Builds in Konflux on New Branch
2+
3+
**Prerequisites:**
4+
5+
- Configuration added in konflux-ci/build-definitions repo
6+
- Existing Konflux-configured branch to copy files from (e.g., `release-0.21`)
7+
8+
**Placeholders:**
9+
10+
- `<target-branch>`: Your target branch (e.g., `release-0.22`)
11+
- `<X-Y>`: Version with dashes (e.g., `0-22`)
12+
- `<component>`: Component name (agent or coredns)
13+
14+
**Important:** Lighthouse uses gomod-only prefetch (NO RPM dependencies). Gomod paths differ per component (see Step 3).
15+
16+
**Repeat steps 1-6 for each component (agent, coredns):**
17+
18+
##### 1. Checkout Bot's PR Branch
19+
20+
Bot creates PRs on branches named `konflux-lighthouse-<component>-<X-Y>`.
21+
22+
```bash
23+
git checkout konflux-lighthouse-<component>-<X-Y>
24+
```
25+
26+
##### 2. Copy Tekton Configuration from Previous Release
27+
28+
```bash
29+
TARGET_VERSION=$(echo "<target-branch>" | grep -oP '(?<=release-0\.)\d+$')
30+
[ -z "$TARGET_VERSION" ] && { echo "ERROR: Invalid branch format"; exit 1; }
31+
PREV_VERSION=$((TARGET_VERSION - 1))
32+
33+
for type in pull-request push; do
34+
git show "origin/release-0.${PREV_VERSION}:.tekton/lighthouse-<component>-0-${PREV_VERSION}-${type}.yaml" | \
35+
sed "s/0-${PREV_VERSION}/0-${TARGET_VERSION}/g; s/release-0\.${PREV_VERSION}/release-0.${TARGET_VERSION}/g" \
36+
> ".tekton/lighthouse-<component>-0-${TARGET_VERSION}-${type}.yaml"
37+
done
38+
```
39+
40+
**Note:** Extracts YAML from previous release and updates versions in one step. Avoids intermediate files and sed parameter insertion bugs.
41+
42+
##### 3. Update Gomod Prefetch Paths
43+
44+
**For lighthouse-agent:**
45+
46+
```bash
47+
sed -i 's|\[{"type": "gomod", "path": "."}, {"type": "gomod", "path": "coredns"}, {"type": "gomod", "path": "tools"}]|[{"type": "gomod", "path": "."}, {"type": "gomod", "path": "tools"}]|' .tekton/lighthouse-agent-0-${TARGET_VERSION}-*.yaml
48+
```
49+
50+
**For lighthouse-coredns:**
51+
52+
```bash
53+
sed -i 's|\[{"type": "gomod", "path": "."}, {"type": "gomod", "path": "coredns"}, {"type": "gomod", "path": "tools"}]|[{"type": "gomod", "path": "./coredns"}]|' .tekton/lighthouse-coredns-0-${TARGET_VERSION}-*.yaml
54+
```
55+
56+
**Note:** Agent uses root+tools modules, coredns uses only coredns module.
57+
58+
##### 4. Add Konflux Dockerfile
59+
60+
```bash
61+
git checkout origin/release-0.${PREV_VERSION} -- package/Dockerfile.lighthouse-<component>.konflux
62+
sed -i "s/release-0.${PREV_VERSION}/release-0.${TARGET_VERSION}/g" package/Dockerfile.lighthouse-<component>.konflux
63+
```
64+
65+
**Note:** Lighthouse Dockerfiles have no CPE labels (only BASE_BRANCH update needed).
66+
67+
##### 5. Commit Changes
68+
69+
```bash
70+
git add .tekton/lighthouse-<component>-0-${TARGET_VERSION}-*.yaml package/Dockerfile.lighthouse-<component>.konflux
71+
git commit -s -m "Add Konflux config for lighthouse-<component>"
72+
```
73+
74+
##### 6. Review and Push
75+
76+
```bash
77+
git log origin/<target-branch>..HEAD
78+
git status
79+
git push origin konflux-lighthouse-<component>-<X-Y> --force-with-lease
80+
```
81+
82+
Expected: 1 commit (bot's initial + your configuration), clean working tree.
83+
84+
##### 7. Verify All Component PRs
85+
86+
After completing both components:
87+
88+
```bash
89+
for component in agent coredns; do
90+
gh pr list --head konflux-lighthouse-$component-<X-Y>
91+
done
92+
```
93+
94+
Expected: 2 PRs (one per component).
95+
96+
**Troubleshooting:**
97+
98+
- **Validation error "impossible ParamValues.Type"**: Step 3 sed pattern mismatch. Check release-0.21's prefetch-input value matches expected format. If different, update Step 3 sed pattern.
99+
- **Commit message too long**: Use exactly "Add Konflux config for lighthouse-<component>" (40-43 chars).
100+
- **RPM lockfiles**: Lighthouse has NO RPM dependencies. Do not create `.rpm-lockfiles` directory.

0 commit comments

Comments
 (0)