mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 21:39:36 +00:00
Replace dapper testing with regular docker (#5805)
* Replace dapper mod test with regular docker Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
24
.drone.yml
24
.drone.yml
@@ -94,7 +94,10 @@ steps:
|
||||
GCLOUD_AUTH:
|
||||
from_secret: gcloud_auth
|
||||
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:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
@@ -190,7 +193,10 @@ steps:
|
||||
GCLOUD_AUTH:
|
||||
from_secret: gcloud_auth
|
||||
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:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
@@ -269,7 +275,10 @@ steps:
|
||||
GCLOUD_AUTH:
|
||||
from_secret: gcloud_auth
|
||||
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:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
@@ -365,7 +374,11 @@ steps:
|
||||
GCLOUD_AUTH:
|
||||
from_secret: gcloud_auth
|
||||
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:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
@@ -387,7 +400,8 @@ steps:
|
||||
- name: validate_go_mods
|
||||
image: rancher/dapper:v0.5.0
|
||||
commands:
|
||||
- dapper -f Dockerfile.test.mod.dapper
|
||||
- docker build --target test-mods -t k3s:mod -f Dockerfile.test .
|
||||
- docker run -i k3s:mod
|
||||
|
||||
volumes:
|
||||
- name: docker
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
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
|
||||
|
||||
@@ -18,13 +32,5 @@ RUN OS=linux; \
|
||||
|
||||
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"]
|
||||
CMD ["test"]
|
||||
CMD ["test"]
|
||||
@@ -1,11 +0,0 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user