Skip to content

Commit c1b059a

Browse files
perdasilvaPer Goncalves da Silva
and
Per Goncalves da Silva
authored
🌱 cleanup: build (#3280)
* remove *_bare.sh scripts Signed-off-by: Per Goncalves da Silva <[email protected]> * remove *_local.sh scripts and related targets Signed-off-by: Per Goncalves da Silva <[email protected]> * remove wait and related targets and hang Dockerfile Signed-off-by: Per Goncalves da Silva <[email protected]> * remove unnecessary makefile targets Signed-off-by: Per Goncalves da Silva <[email protected]> * add golangci-lint to tools Signed-off-by: Per Goncalves da Silva <[email protected]> * refactor Makefile Refactor Makefile clean up build targets Signed-off-by: Per Goncalves da Silva <[email protected]> * bump gha golangci-lint version Signed-off-by: Per Goncalves da Silva <[email protected]> --------- Signed-off-by: Per Goncalves da Silva <[email protected]> Co-authored-by: Per Goncalves da Silva <[email protected]>
1 parent 2334c05 commit c1b059a

File tree

1,857 files changed

+307950
-972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,857 files changed

+307950
-972
lines changed

.github/workflows/build.yml

-17
This file was deleted.

.github/workflows/sanity.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626
- name: Run linting checks
2727
uses: "golangci/golangci-lint-action@v6"
2828
with:
29-
version: "v1.55.2"
29+
version: "v1.58.2"
3030
skip-pkg-cache: true
3131

.golangci.yaml

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
run:
22
timeout: 8m
3-
skip-dirs:
4-
- pkg/lib
5-
- pkg/api
6-
- pkg/fakes
7-
- pkg/package-server/apis
8-
- test/e2e
93

104
linters:
115
enable:
@@ -21,6 +15,11 @@ linters:
2115
- errcheck
2216

2317
linters-settings:
18+
# This stanza is needed to avoid getting the warning
19+
# WARN [config_reader] The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`.
20+
errcheck:
21+
ignore: ''
22+
2423
importas:
2524
alias:
2625
- pkg: k8s.io/api/core/v1
@@ -41,7 +40,13 @@ linters-settings:
4140
issues:
4241
max-issues-per-linter: 0
4342
max-same-issues: 0
43+
exclude-dirs:
44+
- pkg/lib
45+
- pkg/api
46+
- pkg/fakes
47+
- pkg/package-server/apis
48+
- test/e2e
4449

4550
output:
46-
format: tab
51+
formats: tab
4752
sort-results: true

.goreleaser.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,31 @@ builds:
9494
dockers:
9595
- image_templates:
9696
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64"
97-
dockerfile: Dockerfile.goreleaser
97+
dockerfile: Dockerfile
9898
use: buildx
9999
goos: linux
100100
goarch: amd64
101101
build_flag_templates:
102102
- --platform=linux/amd64
103103
- image_templates:
104104
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64"
105-
dockerfile: Dockerfile.goreleaser
105+
dockerfile: Dockerfile
106106
use: buildx
107107
goos: linux
108108
goarch: arm64
109109
build_flag_templates:
110110
- --platform=linux/arm64
111111
- image_templates:
112112
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le"
113-
dockerfile: Dockerfile.goreleaser
113+
dockerfile: Dockerfile
114114
use: buildx
115115
goos: linux
116116
goarch: ppc64le
117117
build_flag_templates:
118118
- --platform=linux/ppc64le
119119
- image_templates:
120120
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x"
121-
dockerfile: Dockerfile.goreleaser
121+
dockerfile: Dockerfile
122122
use: buildx
123123
goos: linux
124124
goarch: s390x

Dockerfile

+8-33
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,15 @@
1-
FROM quay.io/fedora/fedora:37-x86_64 as builder
2-
LABEL stage=builder
3-
WORKDIR /build
4-
5-
# install dependencies and go 1.22
6-
7-
# copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
8-
RUN dnf update -y && dnf install -y bash make git mercurial jq wget && dnf upgrade -y
9-
RUN curl -sSL https://go.dev/dl/go1.22.2.linux-amd64.tar.gz | tar -xzf - -C /usr/local
10-
ENV PATH=/usr/local/go/bin:$PATH
11-
COPY .git/HEAD .git/HEAD
12-
COPY .git/refs/heads/. .git/refs/heads
13-
RUN mkdir -p .git/objects
14-
COPY Makefile Makefile
15-
COPY OLM_VERSION OLM_VERSION
16-
COPY pkg pkg
17-
COPY vendor vendor
18-
COPY go.mod go.mod
19-
COPY go.sum go.sum
20-
COPY cmd cmd
21-
COPY util util
22-
COPY test test
23-
RUN CGO_ENABLED=0 make build
24-
RUN make build-util
25-
26-
# use debug tag to keep a shell around for backwards compatibility with the previous alpine image
271
FROM gcr.io/distroless/static:debug
282
LABEL stage=olm
293
WORKDIR /
304
# bundle unpack Jobs require cp at /bin/cp
315
RUN ["/busybox/ln", "-s", "/busybox/cp", "/bin/cp"]
32-
COPY --from=builder /build/bin/olm /bin/olm
33-
COPY --from=builder /build/bin/catalog /bin/catalog
34-
COPY --from=builder /build/bin/package-server /bin/package-server
35-
COPY --from=builder /build/bin/cpb /bin/cpb
36-
COPY --from=builder /build/bin/copy-content /bin/copy-content
37-
USER 1001
6+
# copy goreleaser built binaries
7+
COPY olm /bin/olm
8+
COPY catalog /bin/catalog
9+
COPY package-server /bin/package-server
10+
COPY copy-content /bin/copy-content
11+
COPY cpb /bin/cpb
3812
EXPOSE 8080
3913
EXPOSE 5443
40-
CMD ["/bin/olm"]
14+
USER 1001
15+
ENTRYPOINT ["/bin/olm"]

0 commit comments

Comments
 (0)