From 642513f154b447e219d303c2de6ab148c70d11ec Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Sat, 10 Jun 2023 12:54:24 +0200 Subject: [PATCH] Fully remove docker-in-docker and cross Signed-off-by: Jacob Kiers --- .drone.jsonnet | 51 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 881a26e..647b5f4 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -12,6 +12,8 @@ local getStepName(arch) = 'Build for ' + arch.short; local builtExecutableName(arch) = executableName + if std.length(std.findSubstr(arch.short, 'windows')) > 0 then '.exe' else ''; local targetExecutableName(arch) = executableName + '-' + arch.target + if std.length(std.findSubstr(arch.short, 'windows')) > 0 then '.exe' else ''; +local rustupAddTarget(arch) = 'rustup target add ' + arch.target; + local add_build_steps() = [ { name: getStepName(arch), @@ -24,13 +26,11 @@ local add_build_steps() = [ ], commands: [ 'echo Hello World from Jsonnet on ' + arch.target + '!', - 'rustup target add ' + arch.target, - 'scripts/prepare-build.sh', - 'cross zigbuild --release --target ' + arch.target, + 'cargo zigbuild --release --target ' + arch.target, 'cp target/' + arch.target + '/release/' + builtExecutableName(arch) + ' artifacts/' + targetExecutableName(arch), 'rm -rf target/' + arch.target + '/release/*', ], - depends_on: ['Wait for Docker'], + depends_on: ['Prepare'], } for arch in archs ]; @@ -44,24 +44,10 @@ local add_build_steps() = [ }, steps: [{ - name: 'Wait for Docker', + name: 'Prepare', image: build_image, - commands: [ - 'mkdir artifacts', - 'echo Using image: ' + build_image, - 'while ! docker image ls; do sleep 1; done', - 'cargo --version', - 'rustc --version', - 'docker info', - 'docker pull hello-world:latest', - ], - environment: { - CROSS_REMOTE: true, - }, - volumes: [{ - name: 'dockersock', - path: '/var/run', - }], + commands: ['scripts/prepare-build.sh'] + + [rustupAddTarget(a) for a in archs], }] + add_build_steps() + [ @@ -91,28 +77,5 @@ local add_build_steps() = [ }, ], - services: [{ - name: 'docker', - image: 'docker:dind', - privileged: true, - volumes: [ - { - name: 'dockersock', - path: '/var/run', - }, - { - name: 'docker-storage', - path: '/var/lib/docker', - }, - ], - }], - - volumes: [ - { - name: 'dockersock', - temp: {}, - }, - ], - image_pull_secrets: ['docker_private_repo'], }