Build with rust v1.66 and cross v0.2.4

Also added some sanity checks. The new docker image now also contains
all required targets and the rust-src component already, which makes it
a bit faster to get started.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
Jacob Kiers 2022-12-16 17:25:08 +01:00
parent 31fda8bae2
commit ea30a49901
2 changed files with 14 additions and 20 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[profile.release]
lto = "thin"
strip = true

View File

@ -1,4 +1,5 @@
local executableName = 'newsletter-to-web'; local executableName = 'newsletter-to-web';
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,16 +17,12 @@ local targetExecutableName(arch) = executableName + if std.startsWith(arch.short
local add_build_steps() = [ local add_build_steps() = [
{ {
name: getStepName(arch), name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', image: cross_image,
volumes: [ volumes: [
{ {
name: 'dockersock', name: 'dockersock',
path: '/var/run', path: '/var/run',
}, },
{
name: 'rustup',
path: '/usr/local/rustup',
},
], ],
commands: [ commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!', 'echo Hello World from Jsonnet on ' + arch.target + '!',
@ -51,13 +48,19 @@ local add_build_steps() = [
steps: steps:
[{ [{
name: 'Wait for Docker', name: 'Wait for Docker',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.65-slim', image: cross_image,
commands: [ commands: [
'mkdir artifacts',
'echo Using image: ' + cross_image,
'while ! docker image ls; do sleep 1; done', 'while ! docker image ls; do sleep 1; done',
'cargo --version',
'rustc --version',
'docker info', 'docker info',
'docker pull hello-world:latest', 'docker pull hello-world:latest',
'mkdir artifacts',
], ],
environment: {
CROSS_REMOTE: true,
},
volumes: [{ volumes: [{
name: 'dockersock', name: 'dockersock',
path: '/var/run', path: '/var/run',
@ -67,7 +70,7 @@ local add_build_steps() = [
[ [
{ {
name: 'Show built artifacts', name: 'Show built artifacts',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim', image: cross_image,
commands: [ commands: [
'ls -lah artifacts', 'ls -lah artifacts',
], ],
@ -112,18 +115,6 @@ local add_build_steps() = [
name: 'dockersock', name: 'dockersock',
temp: {}, temp: {},
}, },
{
name: 'docker-storage',
host: {
path: '/srv/drone/docker-dind-rust',
},
},
{
name: 'rustup',
host: {
path: '/srv/drone/rustup',
},
},
], ],
image_pull_secrets: ['docker_private_repo'], image_pull_secrets: ['docker_private_repo'],