File tree Expand file tree Collapse file tree 6 files changed +46
-15
lines changed
Expand file tree Collapse file tree 6 files changed +46
-15
lines changed Original file line number Diff line number Diff line change 2929 DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
3030 run : echo $DOCKER_HUB_ACCESS_TOKEN | docker login -u $DOCKER_HUB_USERNAME --password-stdin
3131
32+ - name : Set up QEMU
33+ uses : docker/setup-qemu-action@v2
34+
35+ - name : Set up Docker Buildx
36+ uses : docker/setup-buildx-action@v2
37+
3238 - name : e2e-images
3339 run : make e2e-images
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ build-e2e-images:
2020 IMAGE_TAG=$(IMAGE_TAG ) ./e2e/images/build.sh
2121
2222push-e2e-images :
23- IMAGE_TAG=$(IMAGE_TAG ) ./e2e/images/build.sh --push
23+ IMAGE_TAG=$(IMAGE_TAG ) ./e2e/images/build.sh --push --platform ${BUILD_PLATFORMS}
2424
2525# #################################################
2626# tools image #
Original file line number Diff line number Diff line change 1- FROM alpine
1+ FROM --platform=${BUILDPLATFORM} alpine
22
33ENV TERM linux
44RUN apk --no-cache add apache2-utils
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -e
2+ set -euo pipefail
3+
4+ # not all images can be built as multiarch at the moment
5+ # here is a list of images that must be multiarch for e2e tests to pass
6+ declare -A build_as_multiarch=(
7+ [" apache-ab" ]=true
8+ [" websockets" ]=true
9+ )
310
411DIR=$( dirname " $0 " )
512
6- if [ -z " $IMAGE_TAG " ]
7- then
13+ if [[ -z " ${IMAGE_TAG:- } " ]]; then
814 IMAGE_TAG=latest
915fi
1016
17+ options=$( getopt -l " push,platform:" -o " p,x:" -- " $@ " )
18+ eval set -- " $options "
19+
20+ PUSH=false
21+ PLATFORM=" "
22+ while true ; do
23+ case " $1 " in
24+ -p|--push) PUSH=true; shift ;;
25+ -x|--platform) PLATFORM=" $2 " ; shift 2 ;;
26+ --) shift ; break ;;
27+ * ) echo " Invalid option: $1 " >&2 ; exit 1 ;;
28+ esac
29+ done
30+
1131cd $DIR
1232
13- if [ " $1 " == " --push" ]
14- then
15- for IMAGE_NAME in $( find * -name Dockerfile -exec dirname {} \; | tr ' /' ' -' )
16- do
17- docker image push -a ghcr.io/kedacore/tests-$IMAGE_NAME
33+ if [[ " $PUSH " == true ]]; then
34+ for IMAGE in $( find * -name Dockerfile) ; do
35+ IMAGE_NAME=$( dirname $IMAGE | tr ' /' ' -' )
36+ if [[ " $PLATFORM " != " " && " ${build_as_multiarch[$IMAGE_NAME]:- false} " == true ]]; then
37+ echo " building and pushing $IMAGE_NAME from $IMAGE for $PLATFORM "
38+ docker buildx build --push --platform " $PLATFORM " -t " ghcr.io/kedacore/tests-$IMAGE_NAME " ./$IMAGE
39+ else
40+ echo " building and pushing $IMAGE_NAME "
41+ docker image push -a ghcr.io/kedacore/tests-$IMAGE_NAME
42+ fi
1843 done
1944else
20- for IMAGE in $( find * -name Dockerfile)
21- do
45+ for IMAGE in $( find * -name Dockerfile) ; do
2246 IMAGE_NAME=$( dirname $IMAGE | tr ' /' ' -' )
2347 pushd $( dirname $IMAGE )
2448 docker build --label " org.opencontainers.image.source=https://github.com/kedacore/test-tools" -t ghcr.io/kedacore/tests-$IMAGE_NAME :$IMAGE_TAG -t ghcr.io/kedacore/tests-$IMAGE_NAME :latest .
Original file line number Diff line number Diff line change 1- FROM node:22.12.0
1+ FROM --platform=${BUILDPLATFORM} node:22.12.0
22
33WORKDIR /usr/src/app
44
Original file line number Diff line number Diff line change 1- FROM --platform=${BUILDPLATFORM} golang:1.23 -alpine3.19 as builder
1+ FROM --platform=${BUILDPLATFORM} golang:1.24 -alpine3.22 AS builder
22WORKDIR $GOPATH/src/go.k6.io/k6
33RUN apk --no-cache add git
44
55ARG TARGETOS
66ARG TARGETARCH
77ARG K6_VERSION
88RUN go install go.k6.io/xk6/cmd/xk6@latest
9- RUN GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" xk6 build "${K6_VERSION}" \
9+ RUN GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" xk6 build \
10+ --k6-version "${K6_VERSION}" \
1011 --output /tmp/k6 \
1112 --with github.com/grafana/xk6-kubernetes@latest \
1213 --with github.com/grafana/xk6-disruptor@latest \
You can’t perform that action at this time.
0 commit comments