Skip to content

Commit f2798e3

Browse files
committed
Add git-init binary to runner image
As part of RHTAP-5276, we want to start using the runner image in the Tekton Tasks. The git-clone Task, relies on the git-init binary for cloning repositories. This commit compiles from source the latest released version to the runner image. Signed-off-by: Luiz Carvalho <[email protected]>
1 parent 559a09f commit f2798e3

File tree

6 files changed

+808
-0
lines changed

6 files changed

+808
-0
lines changed

.tekton/rhtap-task-runner-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ spec:
4040
{"type": "gomod", "path": "tools/syft"},
4141
{"type": "gomod", "path": "tools/yq"},
4242
{"type": "gomod", "path": "tools/splashy"},
43+
{"type": "gomod", "path": "tools/git-init"},
4344
{"type": "rpm", "path": "tools/rpm-manifests"}
4445
]
4546
- name: build-source-image

.tekton/rhtap-task-runner-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ spec:
3636
{"type": "gomod", "path": "tools/syft"},
3737
{"type": "gomod", "path": "tools/yq"},
3838
{"type": "gomod", "path": "tools/splashy"},
39+
{"type": "gomod", "path": "tools/git-init"},
3940
{"type": "rpm", "path": "tools/rpm-manifests"}
4041
]
4142
- name: build-source-image

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ RUN \
2828
cd splashy && \
2929
go install -trimpath --mod=readonly github.com/redhat-appstudio/tssc-dev-multi-ci/tools/splashy
3030

31+
RUN \
32+
cd git-init && \
33+
go install -trimpath --mod=readonly github.com/tektoncd-catalog/git-clone/git-init
34+
3135
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6@sha256:92b1d5747a93608b6adb64dfd54515c3c5a360802db4706765ff3d8470df6290
3236

3337
# required per https://github.com/release-engineering/rhtap-ec-policy/blob/main/data/rule_data.yml
@@ -54,6 +58,11 @@ COPY --from=ec /usr/local/bin/reduce-snapshot.sh /usr/bin/reduce-snapshot.sh
5458
COPY --from=go-builder /usr/local/bin/yq /usr/bin/yq
5559
COPY --from=go-builder /usr/local/bin/syft /usr/bin/syft
5660
COPY --from=go-builder /usr/local/bin/splashy /usr/bin/splashy
61+
COPY --from=go-builder /usr/local/bin/git-init /usr/bin/git-init
62+
63+
# The git-clone Task expects the `git-init` binary to be available at a specific location, instead
64+
# of relying on $PATH.
65+
RUN mkdir -p /ko-app && ln -s /usr/bin/git-init /ko-app/git-init
5766

5867
WORKDIR /work
5968

tools/git-init/git-init.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package gitinit
2+
3+
import (
4+
// This is only used to populate go.mod with the required dependencies.
5+
_ "github.com/tektoncd-catalog/git-clone/git-init"
6+
)

tools/git-init/go.mod

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
module github.com/redhat-appstudio/tssc-dev-multi-ci/tools/git-int
2+
3+
go 1.23.6
4+
5+
require github.com/tektoncd-catalog/git-clone/git-init v0.0.0
6+
7+
require (
8+
cel.dev/expr v0.19.1 // indirect
9+
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
10+
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
11+
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
12+
github.com/beorn7/perks v1.0.1 // indirect
13+
github.com/blendle/zapdriver v1.3.1 // indirect
14+
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
15+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
16+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
17+
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
18+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
19+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
20+
github.com/go-kit/log v0.2.1 // indirect
21+
github.com/go-logfmt/logfmt v0.5.1 // indirect
22+
github.com/go-logr/logr v1.4.2 // indirect
23+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
24+
github.com/go-openapi/jsonreference v0.21.0 // indirect
25+
github.com/go-openapi/swag v0.23.0 // indirect
26+
github.com/gogo/protobuf v1.3.2 // indirect
27+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
28+
github.com/golang/protobuf v1.5.4 // indirect
29+
github.com/google/cel-go v0.23.2 // indirect
30+
github.com/google/gnostic-models v0.6.8 // indirect
31+
github.com/google/go-cmp v0.7.0 // indirect
32+
github.com/google/gofuzz v1.2.0 // indirect
33+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
34+
github.com/hashicorp/errwrap v1.1.0 // indirect
35+
github.com/hashicorp/go-multierror v1.1.1 // indirect
36+
github.com/josharian/intern v1.0.0 // indirect
37+
github.com/json-iterator/go v1.1.12 // indirect
38+
github.com/mailru/easyjson v0.7.7 // indirect
39+
github.com/mitchellh/go-homedir v1.1.0 // indirect
40+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
41+
github.com/modern-go/reflect2 v1.0.2 // indirect
42+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
43+
github.com/pkg/errors v0.9.1 // indirect
44+
github.com/prometheus/client_golang v1.19.1 // indirect
45+
github.com/prometheus/client_model v0.6.1 // indirect
46+
github.com/prometheus/common v0.55.0 // indirect
47+
github.com/prometheus/procfs v0.15.1 // indirect
48+
github.com/prometheus/statsd_exporter v0.22.7 // indirect
49+
github.com/stoewer/go-strcase v1.2.0 // indirect
50+
github.com/tektoncd/pipeline v0.69.0 // indirect
51+
github.com/x448/float16 v0.8.4 // indirect
52+
go.opencensus.io v0.24.0 // indirect
53+
go.uber.org/multierr v1.11.0 // indirect
54+
go.uber.org/zap v1.27.0 // indirect
55+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
56+
golang.org/x/net v0.38.0 // indirect
57+
golang.org/x/oauth2 v0.27.0 // indirect
58+
golang.org/x/sync v0.12.0 // indirect
59+
golang.org/x/sys v0.31.0 // indirect
60+
golang.org/x/term v0.30.0 // indirect
61+
golang.org/x/text v0.23.0 // indirect
62+
golang.org/x/time v0.9.0 // indirect
63+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
64+
google.golang.org/api v0.217.0 // indirect
65+
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
66+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
67+
google.golang.org/grpc v1.70.0 // indirect
68+
google.golang.org/protobuf v1.36.5 // indirect
69+
gopkg.in/inf.v0 v0.9.1 // indirect
70+
gopkg.in/yaml.v2 v2.4.0 // indirect
71+
gopkg.in/yaml.v3 v3.0.1 // indirect
72+
k8s.io/api v0.31.6 // indirect
73+
k8s.io/apimachinery v0.31.6 // indirect
74+
k8s.io/client-go v0.31.6 // indirect
75+
k8s.io/klog/v2 v2.130.1 // indirect
76+
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect
77+
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
78+
knative.dev/pkg v0.0.0-20250117084104-c43477f0052b // indirect
79+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
80+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
81+
sigs.k8s.io/yaml v1.4.0 // indirect
82+
)
83+
84+
replace github.com/tektoncd-catalog/git-clone/git-init => github.com/tektoncd-catalog/git-clone/image/git-init v0.0.0-20250721094534-2e91df3a9c52

0 commit comments

Comments
 (0)