Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
parent
6cb7d37ce8
commit
678e7247c1
@ -1,4 +1,4 @@
|
|||||||
local cross_image = 'img.kie.rs/jjkiers/rust-dind-cross:1.66-slim-pm';
|
local cross_image = 'img.kie.rs/jjkiers/rust-dind-cross:1.66-full';
|
||||||
|
|
||||||
local archs = [
|
local archs = [
|
||||||
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
|
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
|
||||||
@ -16,6 +16,12 @@ local add_build_steps() = [
|
|||||||
{
|
{
|
||||||
name: getStepName(arch),
|
name: getStepName(arch),
|
||||||
image: cross_image,
|
image: cross_image,
|
||||||
|
volumes: [
|
||||||
|
{
|
||||||
|
name: 'dockersock',
|
||||||
|
path: '/var/run',
|
||||||
|
},
|
||||||
|
],
|
||||||
commands: [
|
commands: [
|
||||||
'echo Hello World from Jsonnet on ' + arch.target + '!',
|
'echo Hello World from Jsonnet on ' + arch.target + '!',
|
||||||
'cross build --release --target ' + arch.target,
|
'cross build --release --target ' + arch.target,
|
||||||
@ -26,7 +32,7 @@ local add_build_steps() = [
|
|||||||
environment: {
|
environment: {
|
||||||
CROSS_REMOTE: true,
|
CROSS_REMOTE: true,
|
||||||
},
|
},
|
||||||
depends_on: ['Start'],
|
depends_on: ['Wait for Docker'],
|
||||||
}
|
}
|
||||||
for arch in archs
|
for arch in archs
|
||||||
];
|
];
|
||||||
@ -40,15 +46,18 @@ local add_build_steps() = [
|
|||||||
},
|
},
|
||||||
steps:
|
steps:
|
||||||
[{
|
[{
|
||||||
name: 'Start',
|
name: 'Wait for Docker',
|
||||||
image: cross_image,
|
image: cross_image,
|
||||||
commands: [
|
commands: [
|
||||||
'mkdir artifacts',
|
'mkdir artifacts',
|
||||||
'while ! podman image ls; do sleep 1; done',
|
'while ! docker image ls; do sleep 1; done',
|
||||||
'podman info',
|
'docker info',
|
||||||
'podman pull hello-world:latest',
|
'docker pull hello-world:latest',
|
||||||
'podman run --rm hello-world:latest',
|
|
||||||
],
|
],
|
||||||
|
volumes: [{
|
||||||
|
name: 'dockersock',
|
||||||
|
path: '/var/run',
|
||||||
|
}],
|
||||||
}] +
|
}] +
|
||||||
add_build_steps() +
|
add_build_steps() +
|
||||||
[
|
[
|
||||||
@ -78,5 +87,34 @@ 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: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'docker-storage',
|
||||||
|
host: {
|
||||||
|
path: '/srv/drone/docker-dind-rust',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
image_pull_secrets: ['docker_private_repo'],
|
image_pull_secrets: ['docker_private_repo'],
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user