Compare commits

..

No commits in common. "b5a83988e899197986efaf4009f329a2778cccd9" and "a427e41bd501e8546cbd47f2a584dab40b9e8cdf" have entirely different histories.

View File

@ -1,41 +1,41 @@
local archs = [ local archs = [
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' }, { target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
{ target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' }, { target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' },
{ target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' }, // { target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' },
{ target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' }, { target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' },
{ target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' }, { target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' },
]; ];
local getStepName(arch) = 'Build for ' + arch.short; local getStepName(arch) = 'check ' + arch.short;
local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else ''; local buildForArch(arch) = {
name: getStepName(arch),
local add_build_steps() = [ image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
{ volumes: [
name: getStepName(arch), {
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', name: 'dockersock',
volumes: [ path: '/var/run',
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch),
'rm -rf target/' + arch.target + '/release/*',
],
environment: {
CROSS_REMOTE: true,
}, },
depends_on: ['wait-for-docker'], {
} name: 'rustup',
for arch in archs path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}',
'cp target/' + arch.target + '/release/drone-test artifacts/drone-test-' + arch.short,
],
environment: {
CROSS_REMOTE: true,
},
depends_on: ['wait-for-docker'],
};
local check_steps() = [
buildForArch(a)
for a in archs
]; ];
{ {
@ -47,7 +47,7 @@ local add_build_steps() = [
}, },
steps: steps:
[{ [{
name: 'Wait for Docker', name: 'wait-for-docker',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [ commands: [
'while ! docker image ls; do sleep 1; done', 'while ! docker image ls; do sleep 1; done',
@ -60,12 +60,13 @@ local add_build_steps() = [
path: '/var/run', path: '/var/run',
}], }],
}] + }] +
add_build_steps() + check_steps() +
[ [
{ {
name: 'Show built artifacts', name: 'build',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [ commands: [
'ls -lah target/',
'ls -lah artifacts', 'ls -lah artifacts',
], ],
depends_on: [getStepName(a) for a in archs], depends_on: [getStepName(a) for a in archs],