You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(api): Add Integration Git Branch, Commit, Tag options
- Allows to select branch, tag or commit for Git source
- closes: #6135
Changes:
- make the project cloning for the default branch shallow (depth 1 commit)
- add option to checkout Git tag and test it
- add option to checkout Git branch and test it
- add option to checkout Git commit and test it (this is the least efficient of the 3 as it requires the full project history checkout)
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/running/build-from-git.adoc
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,38 @@ The operator will start a Build custom resource, whose goal is to build and pack
33
33
34
34
The `kamel` CLI is equipped with a `--git` option that you can use to provide the project repository.
35
35
36
+
== Specifying Branch, Tag or Commit
37
+
38
+
By default, Camel K clones the repository's default branch (usually `main`). You can specify a different branch, tag, or specific commit using either CLI options or YAML configuration:
39
+
40
+
=== Using CLI Options
41
+
42
+
```bash
43
+
# Clone specific branch
44
+
kamel run --git https://github.com/michalvavrik/sample.git --git-branch feature/xyz
45
+
46
+
# Clone specific tag
47
+
kamel run --git https://github.com/michalvavrik/sample.git --git-tag v1.2.3
48
+
49
+
# Clone the project and checkout specific commit (full SHA)
50
+
kamel run --git https://github.com/michalvavrik/sample.git --git-commit f2b9bd064a62263ab53b3bfe6ac2b71e68dba45b
51
+
```
52
+
53
+
=== Using YAML Configuration
54
+
55
+
```yaml
56
+
apiVersion: camel.apache.org/v1
57
+
kind: Integration
58
+
metadata:
59
+
name: sample
60
+
spec:
61
+
git:
62
+
url: https://github.com/michalvavrik/sample.git
63
+
branch: feature/xyz # Use specific branch
64
+
# tag: v1.2.3 # Or use specific tag
65
+
# commit: f2b9bd064a62263ab53b3bfe6ac2b71e68dba45b # Or use specific commit
66
+
```
67
+
36
68
== Rebuild
37
69
38
70
In order to trigger a rebuild of an Integration you will need to `kamel reset` or to wipe off the Integration `status` as it normally happens for any other regular Integration.
0 commit comments