File tree Expand file tree Collapse file tree
test/e2e/argocd-server-mock Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 image : codeready-toolchain/argocd-mcp-server
2323 tags : latest ${{ env.COMMIT_SHORT_SHA }}
2424 containerfiles : Containerfile
25+ platforms : linux/amd64
2526
2627 - name : Log into quay.io
2728 uses : redhat-actions/podman-login@v1
Original file line number Diff line number Diff line change 2929 run : |
3030 task test
3131
32-
3332 - name : Install Podman
3433 uses : redhat-actions/podman-install@main
3534
4443 export PATH="$GOPATH/bin:$PATH"
4544 task test-e2e
4645
46+ build-image :
47+ # verifying the image can be built (real build and push is done in the `cd` workflow)
48+ name : Build Image
49+ runs-on : ubuntu-24.04
50+ steps :
51+ - name : Checkout code
52+ uses : actions/checkout@v6
53+
54+ - name : Build image
55+ id : build-image
56+ uses : redhat-actions/buildah-build@v2
57+ with :
58+ image : codeready-toolchain/argocd-mcp-server
59+ tags : latest # we won't push the image to a registry in this workflow, so we're good with just the `latest` tag
60+ containerfiles : Containerfile
61+ platforms : linux/amd64
62+
4763 lint :
4864 name : Lint
4965 runs-on : ubuntu-24.04
Original file line number Diff line number Diff line change 22# Builder image
33# See https://hub.docker.com/_/golang/
44# ###############################################################################################
5- FROM golang:1.24 as builder
6-
7- ARG OS=linux
8- ARG ARCH=amd64
5+ FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
96
107WORKDIR /usr/src/app
118
9+ ARG TARGETOS
10+ ARG TARGETARCH
11+
12+ RUN echo "Building the 'argocd-mcp-server' binary for $TARGETOS/$TARGETARCH"
13+
1214# pre-copy/cache parent go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
1315COPY go.mod go.sum ./
1416RUN go mod download && go mod verify
1517
1618COPY . .
1719
18- RUN go build -o /usr/src/app/argocd-mcp-server main.go
20+ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /usr/src/app/argocd-mcp-server main.go
1921RUN ls -la /usr/src/app/argocd-mcp-server
2022
2123# ###############################################################################################
22- # image to be run by the GitHub Action job
24+ # image to be deployed to the target platform
2325# ###############################################################################################
24- FROM registry.access.redhat.com/ubi9 /ubi-minimal :latest as argocd-mcp-server
26+ FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi10 /ubi-micro :latest AS argocd-mcp-server
2527
2628# Copy the generated binary into the $PATH so it can be invoked
2729COPY --from=builder /usr/src/app/argocd-mcp-server /usr/local/bin/
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ tasks:
3838 # The idiomatic way to disable test caching explicitly is to use -count=1
3939 - go test github.com/codeready-toolchain/argocd-mcp-server/test/e2e/... -count=1 -v -failfast
4040
41- # Continuous Deployment
4241 build-image :
4342 cmds :
44- - podman build --platform linux/amd64 --no-cache -t argocd-mcp-server:latest . -f Containerfile
43+ - podman build --no-cache -t argocd-mcp-server:latest . -f Containerfile
44+
45+ build-image-linux-amd64 :
46+ cmds :
47+ - podman build --platform linux/amd64 --no-cache -t argocd-mcp-server:amd64 . -f Containerfile
Original file line number Diff line number Diff line change 44# ###############################################################################################
55FROM golang:1.24 as argocd-mock-server-builder
66
7- ARG OS=linux
8- ARG ARCH=amd64
9-
107WORKDIR /usr/src/app
118
129# pre-copy/cache parent go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
You can’t perform that action at this time.
0 commit comments