Unverified Commit 86fc9407 authored by Derek Nola's avatar Derek Nola Committed by GitHub

Replace dapper testing with regular docker (#5805)

* Replace dapper mod test with regular docker Signed-off-by: 's avatarDerek Nola <derek.nola@suse.com>
parent d2089872
...@@ -94,7 +94,10 @@ steps: ...@@ -94,7 +94,10 @@ steps:
GCLOUD_AUTH: GCLOUD_AUTH:
from_secret: gcloud_auth from_secret: gcloud_auth
commands: commands:
- dapper -f Dockerfile.test.dapper - docker build --target test-k3s -t k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT} -f Dockerfile.test .
- >
docker run -i -e REPO -e TAG -e DRONE_TAG -e DRONE_BUILD_EVENT -e IMAGE_NAME -e GCLOUD_AUTH -e SONOBUOY_VERSION -e ENABLE_REGISTRY
-v /var/run/docker.sock:/var/run/docker.sock --privileged --network host -v /tmp:/tmp k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT}
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
...@@ -190,7 +193,10 @@ steps: ...@@ -190,7 +193,10 @@ steps:
GCLOUD_AUTH: GCLOUD_AUTH:
from_secret: gcloud_auth from_secret: gcloud_auth
commands: commands:
- dapper -f Dockerfile.test.dapper - docker build --target test-k3s -t k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT} -f Dockerfile.test .
- >
docker run -i -e REPO -e TAG -e DRONE_TAG -e DRONE_BUILD_EVENT -e IMAGE_NAME -e GCLOUD_AUTH -e SONOBUOY_VERSION -e ENABLE_REGISTRY
-v /var/run/docker.sock:/var/run/docker.sock --privileged --network host -v /tmp:/tmp k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT}
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
...@@ -269,7 +275,10 @@ steps: ...@@ -269,7 +275,10 @@ steps:
GCLOUD_AUTH: GCLOUD_AUTH:
from_secret: gcloud_auth from_secret: gcloud_auth
commands: commands:
- dapper -f Dockerfile.test.dapper - docker build --target test-k3s -t k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT} -f Dockerfile.test .
- >
docker run -i -e REPO -e TAG -e DRONE_TAG -e DRONE_BUILD_EVENT -e IMAGE_NAME -e GCLOUD_AUTH -e SONOBUOY_VERSION -e ENABLE_REGISTRY
-v /var/run/docker.sock:/var/run/docker.sock --privileged --network host -v /tmp:/tmp k3s:test-${DRONE_STAGE_ARCH}-${DRONE_COMMIT}
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
...@@ -365,7 +374,11 @@ steps: ...@@ -365,7 +374,11 @@ steps:
GCLOUD_AUTH: GCLOUD_AUTH:
from_secret: gcloud_auth from_secret: gcloud_auth
commands: commands:
- dapper -f Dockerfile.test.dapper # we hardcode s390x as the arch because DRONE_STAGE_ARCH is set to amd64
- docker build --target test-k3s -t k3s:test-s390x-${DRONE_COMMIT} -f Dockerfile.test .
- >
docker run -i -e REPO -e TAG -e DRONE_TAG -e DRONE_BUILD_EVENT -e IMAGE_NAME -e GCLOUD_AUTH -e SONOBUOY_VERSION -e ENABLE_REGISTRY
-v /var/run/docker.sock:/var/run/docker.sock --privileged --network host -v /tmp:/tmp k3s:test-s390x-${DRONE_COMMIT}
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
...@@ -387,7 +400,8 @@ steps: ...@@ -387,7 +400,8 @@ steps:
- name: validate_go_mods - name: validate_go_mods
image: rancher/dapper:v0.5.0 image: rancher/dapper:v0.5.0
commands: commands:
- dapper -f Dockerfile.test.mod.dapper - docker build --target test-mods -t k3s:mod -f Dockerfile.test .
- docker run -i k3s:mod
volumes: volumes:
- name: docker - name: docker
......
ARG GOLANG=golang:1.18.1-alpine3.15 ARG GOLANG=golang:1.18.1-alpine3.15
FROM ${GOLANG} FROM ${GOLANG} as test-base
RUN apk -U --no-cache add bash git gcc musl-dev docker curl jq coreutils python3 openssl py3-pip procps RUN apk -U --no-cache add bash jq
ENV K3S_SOURCE /go/src/github.com/k3s-io/k3s/
WORKDIR ${K3S_SOURCE}
COPY . ${K3S_SOURCE}
From test-base as test-mods
COPY ./scripts/test-mods /bin/
ENTRYPOINT ["/bin/test-mods"]
From test-base as test-k3s
RUN apk -U --no-cache add git gcc musl-dev docker curl coreutils python3 openssl py3-pip procps
ENV SONOBUOY_VERSION 0.56.5 ENV SONOBUOY_VERSION 0.56.5
...@@ -18,13 +32,5 @@ RUN OS=linux; \ ...@@ -18,13 +32,5 @@ RUN OS=linux; \
ENV TEST_CLEANUP true ENV TEST_CLEANUP true
ENV DAPPER_RUN_ARGS --privileged --network host -v /tmp:/tmp
ENV DAPPER_ENV REPO TAG DRONE_TAG DRONE_BUILD_EVENT IMAGE_NAME GCLOUD_AUTH SONOBUOY_VERSION ENABLE_REGISTRY
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/k3s/
ENV DAPPER_OUTPUT ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry.sh"] ENTRYPOINT ["./scripts/entry.sh"]
CMD ["test"] CMD ["test"]
\ No newline at end of file
ARG GOLANG=golang:1.18.1-alpine3.15
FROM ${GOLANG}
RUN apk -U --no-cache add bash jq
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/k3s/
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
COPY ./scripts/test-mods /bin/
ENTRYPOINT ["/bin/test-mods"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment