diff --git a/.drone.yml b/.drone.yml index edc0e204c..9c68f0c19 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ platform: steps: - name: ci pull: default - image: rancher/dapper:v0.6.0 + image: rancher/dapper:1.11.2 commands: - dapper ci - ls -lR build/bin @@ -24,6 +24,18 @@ steps: - pull_request - tag +- name: stage-binaries + pull: default + image: rancher/dapper:1.11.2 + commands: + - "cp -r ./bin/* ./package/" + when: + event: + - tag + ref: + include: + - "refs/tags/*" + - name: github_binary_prerelease pull: default image: plugins/github-release @@ -105,7 +117,7 @@ platform: steps: - name: build pull: default - image: rancher/dapper:v0.6.0 + image: rancher/dapper:1.11.2 commands: - dapper build privileged: true @@ -119,7 +131,7 @@ steps: - name: integration-flannel pull: default - image: rancher/dapper:v0.6.0 + image: rancher/dapper:1.11.2 commands: - dapper integration flannel privileged: true @@ -133,7 +145,7 @@ steps: - name: integration-calico pull: default - image: rancher/dapper:v0.6.0 + image: rancher/dapper:1.11.2 commands: - dapper integration calico privileged: true @@ -147,7 +159,7 @@ steps: - name: integration-weave pull: default - image: rancher/dapper:v0.6.0 + image: rancher/dapper:1.11.2 commands: - dapper integration weave privileged: true diff --git a/Dockerfile.dapper b/Dockerfile.dapper index b84d584bd..1756835e7 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,11 +1,26 @@ -FROM registry.suse.com/bci/golang:1.19-20.16 +FROM ubuntu:20.04 +# FROM arm=armhf/ubuntu:20.04 arm64=arm64v8/ubuntu:20.04 ARG DAPPER_HOST_ARCH ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} -RUN zypper -n in docker awk +RUN apt-get update && \ + apt-get install -y gcc ca-certificates git wget curl vim less file kmod iptables xz-utils zip && \ + rm -f /bin/sh && ln -s /bin/bash /bin/sh -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.1 +ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ + GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash + +RUN wget -O - https://storage.googleapis.com/golang/go1.19.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local + +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.46.2 + +ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \ + DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \ + DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \ + DOCKER_URL=DOCKER_URL_${ARCH} + +RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker ENV DAPPER_SOURCE /go/src/github.com/rancher/rke/ ENV DAPPER_RUN_ARGS --privileged -v /var/lib/docker diff --git a/dind/dind.go b/dind/dind.go index c3eb74293..5a0fd50b3 100644 --- a/dind/dind.go +++ b/dind/dind.go @@ -13,7 +13,7 @@ import ( ) const ( - DINDImage = "docker:20.10.23-dind" + DINDImage = "docker:19.03.12-dind" DINDContainerPrefix = "rke-dind" DINDPlane = "dind" DINDNetwork = "dind-network" @@ -66,7 +66,7 @@ func StartUpDindContainer(ctx context.Context, dindAddress, dindNetwork, dindSto "mount --make-shared / && " + "mount --make-shared /sys && " + "mount --make-shared /var/lib/docker && " + - "dockerd-entrypoint.sh --tls=false --storage-driver=" + storageDriver, + "dockerd-entrypoint.sh --storage-driver=" + storageDriver, }, Hostname: dindAddress, Env: []string{"DOCKER_TLS_CERTDIR="}, diff --git a/package/Dockerfile b/package/Dockerfile new file mode 100644 index 000000000..41a8bda6a --- /dev/null +++ b/package/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:20.04 +COPY rke /usr/bin/ +CMD ["rke"] diff --git a/scripts/package b/scripts/package index 50d1d3bfe..072aba9f3 100755 --- a/scripts/package +++ b/scripts/package @@ -10,3 +10,23 @@ SUFFIX="" [ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}" ./scripts/create-releasenote.sh + +cd package + +TAG=${TAG:-${VERSION}${SUFFIX}} +REPO=${REPO:-rke} + +if echo $TAG | grep -q dirty; then + TAG=dev +fi + +if [ -n "$DRONE_TAG" ]; then + TAG=$DRONE_TAG +fi + +cp ../bin/rke . + +IMAGE=${REPO}/rke:${TAG} +docker build -t ${IMAGE} . +echo ${IMAGE} > ../dist/images +echo Built ${IMAGE} diff --git a/scripts/test b/scripts/test index 84fe0c201..d005aba0e 100755 --- a/scripts/test +++ b/scripts/test @@ -7,5 +7,6 @@ echo Running tests PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')" -go test -cover -tags=test ${PACKAGES} +[ "${ARCH}" == "amd64" ] && RACE=-race +go test ${RACE} -cover -tags=test ${PACKAGES} diff --git a/types/kdm/zz_generated_deepcopy.go b/types/kdm/zz_generated_deepcopy.go index 313fbacf4..a36f459aa 100644 --- a/types/kdm/zz_generated_deepcopy.go +++ b/types/kdm/zz_generated_deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2023 Rancher Labs, Inc. +Copyright 2024 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/types/zz_generated_deepcopy.go b/types/zz_generated_deepcopy.go index 14a31583f..1b8a68968 100644 --- a/types/zz_generated_deepcopy.go +++ b/types/zz_generated_deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2023 Rancher Labs, Inc. +Copyright 2024 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.