Tests/E2E: include heper image builds in e2e tests

pull/287/head
iwilltry42 4 years ago
parent 24f92b9c3f
commit 7e775f009f
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 2
      Dockerfile
  2. 7
      Makefile
  3. 7
      tests/dind.sh
  4. 2
      tools/Dockerfile
  5. 2
      tools/Makefile

@ -4,7 +4,7 @@ COPY . .
RUN make build && bin/k3d version RUN make build && bin/k3d version
FROM docker:19.03-dind as dind FROM docker:19.03-dind as dind
RUN apk add bash curl sudo jq RUN apk add bash curl sudo jq git make
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \ chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl mv ./kubectl /usr/local/bin/kubectl

@ -111,6 +111,13 @@ build-docker-%:
@echo "Building Docker image k3d:$(K3D_IMAGE_TAG)-$*" @echo "Building Docker image k3d:$(K3D_IMAGE_TAG)-$*"
docker build . -t k3d:$(K3D_IMAGE_TAG)-$* --target $* docker build . -t k3d:$(K3D_IMAGE_TAG)-$* --target $*
# build helper images
build-helper-images:
@echo "Building docker image rancher/k3d-proxy:$(GIT_TAG)"
docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(GIT_TAG)
@echo "Building docker image rancher/k3d-tools:$(GIT_TAG)"
docker build --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(GIT_TAG) --build-arg GIT_TAG=$(GIT_TAG)
############################## ##############################
########## Cleaning ########## ########## Cleaning ##########
############################## ##############################

@ -14,7 +14,7 @@ RUNNER_START_TIMEOUT=${E2E_RUNNER_START_TIMEOUT:-10}
# Start the runner container # Start the runner container
TIMESTAMP=$(date "+%y%m%d%H%M%S") TIMESTAMP=$(date "+%y%m%d%H%M%S")
k3de2e=$(docker run -d \ k3de2e=$(docker run -d \
-v "$(pwd)/tests:/tests" \ -v "$(pwd):/src" \
--privileged \ --privileged \
-e EXE="$K3D_EXE" \ -e EXE="$K3D_EXE" \
-e CI="true" \ -e CI="true" \
@ -43,5 +43,8 @@ until docker inspect "$k3de2e" | jq ".[0].State.Running" && docker logs "$k3de2e
(( TIMEOUT++ )) (( TIMEOUT++ ))
done done
# build helper container images
docker exec --workdir /src "$k3de2e" make build-helper-images
# execute tests # execute tests
docker exec "$k3de2e" /tests/runner.sh docker exec "$k3de2e" /src/tests/runner.sh

@ -1,6 +1,8 @@
FROM golang:1.14 as builder FROM golang:1.14 as builder
ARG GIT_TAG
WORKDIR /app WORKDIR /app
COPY . . COPY . .
ENV GIT_TAG=${GIT_TAG}
ENV GO111MODULE=on ENV GO111MODULE=on
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
RUN make build RUN make build

@ -1,7 +1,7 @@
SHELL := /bin/bash SHELL := /bin/bash
# get git tag # get git tag
GIT_TAG := $(shell git describe --tags) GIT_TAG ?= $(shell git describe --tags)
ifeq ($(GIT_TAG),) ifeq ($(GIT_TAG),)
GIT_TAG := $(shell git describe --always) GIT_TAG := $(shell git describe --always)
endif endif

Loading…
Cancel
Save