Small improvements
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
Jacob Kiers 2022-09-07 22:18:38 +02:00
parent 7bc8c5b967
commit 2a041ae332

View File

@ -6,7 +6,7 @@ local archs = [
{ target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' }, { target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' },
]; ];
local getStepName(arch) = 'build ' + arch.short; local getStepName(arch) = 'Build for ' + arch.short;
local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else ''; local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else '';
@ -27,13 +27,13 @@ local add_build_steps() = [
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,
'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}',
'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch), 'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch),
'rm -rf target/' + arch.target + '/release/*',
], ],
environment: { environment: {
CROSS_REMOTE: true, CROSS_REMOTE: true,
}, },
depends_on: ['wait-for-docker'], depends_on: ['Wait for Docker'],
} }
for arch in archs for arch 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',
@ -63,10 +63,9 @@ local add_build_steps() = [
add_build_steps() + add_build_steps() +
[ [
{ {
name: 'build', name: 'Show built artifacts',
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],