Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang makefile fixups #3402

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Dockerfile.golang-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG REGISTRY
FROM ${REGISTRY}/ubi8/go-toolset:1.18.10 as builder

USER root
ENV GOPATH=/root/go
RUN mkdir -p /app
WORKDIR /app
COPY . /app
run make generate
RUN make build-all
RUN [[ -z "$(git status -s)" ]]

FROM builder as vendor-check
WORKDIR /app
COPY --from=builder /app/aro /app/e2e.test /usr/local/bin/
RUN go mod vendor && go mod tidy -compat=1.18 && hack/ci-utils/isClean.sh

FROM builder as lint-go
WORKDIR /app
COPY --from=builder /app/aro /app/e2e.test /usr/local/bin/
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.55.2
RUN make lint-go

FROM builder as unit-test-go
WORKDIR /app
COPY --from=builder /app/aro /app/e2e.test /usr/local/bin/
RUN ARO_RUN_PKI_TESTS=nope make unit-test-go

FROM builder as validate-fips
WORKDIR /app
COPY --from=builder /app/aro /app/e2e.test /usr/local/bin/
RUN make validate-fips

FROM ${REGISTRY}/ubi8/ubi-minimal
RUN microdnf update && microdnf clean all
COPY --from=builder /app/aro /app/e2e.test /usr/local/bin/
ENTRYPOINT ["aro"]
EXPOSE 2222/tcp 8080/tcp 8443/tcp 8444/tcp 8445/tcp
USER 1000
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ clean:
find python -type d -name __pycache__ -delete
find -type d -name 'gomock_reflect_[0-9]*' -exec rm -rf {} \+ 2>/dev/null

ci:
docker build --platform=linux/amd64 --network=host --build-arg REGISTRY=$(REGISTRY) -f Dockerfile.golang-ci --skip-unused-stages=false

client: generate
hack/build-client.sh "${AUTOREST_IMAGE}" 2020-04-30 2021-09-01-preview 2022-04-01 2022-09-04 2023-04-01 2023-07-01-preview 2023-09-04 2023-11-22

Expand Down
Loading