diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ace1145024..4b3f5f92aa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -112,32 +112,3 @@ jobs: export PATH=${PATH}:$GOPATH/bin make verify binary test test/integration timeout-minutes: 14 - build-push-fleet-manager-tools: - name: "Build and push fleet-manager-tools image to quay.io" - runs-on: ubuntu-latest - needs: [pre-commit, verify-test] - # Skip for external contributions. - if: | - github.event_name == 'push' || !github.event.pull_request.head.repo.fork - steps: - - name: Login to Quay.io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_RHACS_ENG_FM_RW_USERNAME }} - password: ${{ secrets.QUAY_RHACS_ENG_FM_RW_PASSWORD }} - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Critical for correct image detection in Makefile - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.23" - - name: Build and push fleet-manager-tools image to quay.io - if: github.event_name == 'push' - env: - TAG: ${{ github.ref_name }} - run: make image/push/fleet-manager-tools diff --git a/Makefile b/Makefile index fc4e148588..04e865cc5c 100644 --- a/Makefile +++ b/Makefile @@ -556,25 +556,6 @@ image/build/probe: $(DOCKER) tag $(IMAGE_REF) $(PROBE_SHORT_IMAGE_REF) .PHONY: image/build/probe -image/build/fleet-manager-tools: GOOS=linux -image/build/fleet-manager-tools: IMAGE_REF="$(external_image_registry)/fleet-manager-tools:$(image_tag)" -image/build/fleet-manager-tools: fleet-manager fleetshard-sync acsfleetctl - $(DOCKER) build -t $(IMAGE_REF) -f tools.Dockerfile . - $(DOCKER) tag $(IMAGE_REF) fleet-manager-tools:$(image_tag) -.PHONY: image/build/fleet-manager-tools - -image/push/fleet-manager-tools: IMAGE_REF="$(external_image_registry)/fleet-manager-tools:$(image_tag)" -image/push/fleet-manager-tools: image/build/fleet-manager-tools - $(DOCKER) push $(IMAGE_REF) - @echo - @echo "Image fleet-manager-tools was pushed as $(IMAGE_REF)." -.PHONY: image/push/fleet-manager-tools - -image/push/fleet-manager-tools/internal: IMAGE_TAG ?= $(image_tag) -image/push/fleet-manager-tools/internal: docker/login/internal - $(DOCKER) buildx build -t "$(shell oc get route default-route -n openshift-image-registry -o jsonpath="{.spec.host}")/$(NAMESPACE)/fleet-manager-tools:$(IMAGE_TAG)" --platform linux/amd64 --push -f tools.Dockerfile . -.PHONY: image/push/fleet-manager-tools/internal - image/build/emailsender: GOOS=linux image/build/emailsender: IMAGE_REF="$(external_image_registry)/$(emailsender_image_repository):$(image_tag)" image/build/emailsender: diff --git a/tools.Dockerfile b/tools.Dockerfile deleted file mode 100644 index 9c817572e3..0000000000 --- a/tools.Dockerfile +++ /dev/null @@ -1,56 +0,0 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.23.6-4 AS build -USER root -RUN mkdir /src -WORKDIR /src - -RUN go env -w GOCACHE=/go/.cache; \ - go env -w GOMODCACHE=/go/pkg/mod - -# Use the docker build cache to avoid calling 'go mod download' if go.mod/go.sum have not been changed. -# Otherwise, use cache mount to cache dependencies between builds. -# mount=type=bind is intentionally not used to ensure compatibility between docker and podman. -# See: -# - https://docs.docker.com/build/cache/ -# - https://docs.docker.com/build/guide/mounts/ -# - https://github.com/containers/podman/issues/15423 -COPY go.* ./ -RUN --mount=type=cache,target=/go/pkg/mod/ \ - go mod download - -COPY . ./ - -ARG TARGETARCH - -RUN --mount=type=cache,target=/go/pkg/mod/ \ - --mount=type=cache,target=/go/.cache/ \ - make binary GOARCH=${TARGETARCH} - -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1295 AS standard - -ENV KUBECTL_VERSION=v1.28.1 - -COPY --from=build /src/fleet-manager /src/fleetshard-sync /src/acsfleetctl /usr/local/bin/ - -RUN microdnf install tar gzip - -# Install kubeval -RUN curl -LO https://github.com/instrumenta/kubeval/releases/download/v0.16.1/kubeval-linux-amd64.tar.gz -RUN curl -LO "https://github.com/instrumenta/kubeval/releases/download/v0.16.1/checksums.txt" -RUN cat checksums.txt | grep linux-amd64 | sha256sum --check -RUN tar -xf kubeval-linux-amd64.tar.gz - -RUN mv kubeval /usr/bin/kubeval -RUN chmod +x /usr/bin/kubeval -RUN rm kubeval-linux-amd64.tar.gz - -# Install kubectl -RUN curl -o /usr/bin/kubectl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl" -RUN chmod +x /usr/bin/kubectl -RUN curl -LO "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256" -RUN echo "$(cat kubectl.sha256) /usr/bin/kubectl" | sha256sum --check - -LABEL name="fleet-manager-tools" \ - vendor="Red Hat" \ - version="0.0.1" \ - summary="FleetManagerTools" \ - description="RHACS fleet-manager tools used for CI pipelines"