Skip to content

Commit

Permalink
Move to BCI
Browse files Browse the repository at this point in the history
  • Loading branch information
superseb authored and manuelbuil committed Jan 10, 2024
1 parent df543ef commit 697222e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 62 deletions.
22 changes: 5 additions & 17 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ platform:
steps:
- name: ci
pull: default
image: rancher/dapper:1.11.2
image: rancher/dapper:v0.6.0
commands:
- dapper ci
- ls -lR build/bin
Expand All @@ -24,18 +24,6 @@ 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
Expand Down Expand Up @@ -117,7 +105,7 @@ platform:
steps:
- name: build
pull: default
image: rancher/dapper:1.11.2
image: rancher/dapper:v0.6.0
commands:
- dapper build
privileged: true
Expand All @@ -131,7 +119,7 @@ steps:

- name: integration-flannel
pull: default
image: rancher/dapper:1.11.2
image: rancher/dapper:v0.6.0
commands:
- dapper integration flannel
privileged: true
Expand All @@ -145,7 +133,7 @@ steps:

- name: integration-calico
pull: default
image: rancher/dapper:1.11.2
image: rancher/dapper:v0.6.0
commands:
- dapper integration calico
privileged: true
Expand All @@ -159,7 +147,7 @@ steps:

- name: integration-weave
pull: default
image: rancher/dapper:1.11.2
image: rancher/dapper:v0.6.0
commands:
- dapper integration weave
privileged: true
Expand Down
21 changes: 3 additions & 18 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
FROM ubuntu:20.04
# FROM arm=armhf/ubuntu:20.04 arm64=arm64v8/ubuntu:20.04
FROM registry.suse.com/bci/golang:1.19-20.16

ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}

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 zypper -n in docker awk

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
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.1

ENV DAPPER_SOURCE /go/src/github.com/rancher/rke/
ENV DAPPER_RUN_ARGS --privileged -v /var/lib/docker
Expand Down
4 changes: 2 additions & 2 deletions dind/dind.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
DINDImage = "docker:19.03.12-dind"
DINDImage = "docker:20.10.23-dind"
DINDContainerPrefix = "rke-dind"
DINDPlane = "dind"
DINDNetwork = "dind-network"
Expand Down Expand Up @@ -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 --storage-driver=" + storageDriver,
"dockerd-entrypoint.sh --tls=false --storage-driver=" + storageDriver,
},
Hostname: dindAddress,
Env: []string{"DOCKER_TLS_CERTDIR="},
Expand Down
3 changes: 0 additions & 3 deletions package/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,3 @@ 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}
3 changes: 1 addition & 2 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ 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!$!/...!')"

[ "${ARCH}" == "amd64" ] && RACE=-race
go test ${RACE} -cover -tags=test ${PACKAGES}
go test -cover -tags=test ${PACKAGES}

0 comments on commit 697222e

Please sign in to comment.