2022-08-10 23:10:39 +00:00
|
|
|
local archs = [
|
2022-08-11 07:31:55 +00:00
|
|
|
'aarch64-unknown-linux-gnu',
|
|
|
|
'aarch64-unknown-linux-musl',
|
|
|
|
'x86_64-pc-windows-gnu',
|
|
|
|
'x86_64-unknown-linux-gnu',
|
|
|
|
'x86_64-unknown-linux-musl',
|
2022-08-10 23:11:42 +00:00
|
|
|
];
|
2022-08-10 23:10:39 +00:00
|
|
|
|
2022-08-11 07:31:55 +00:00
|
|
|
local getStepName(arch) = 'check ' + arch;
|
2022-08-10 23:10:39 +00:00
|
|
|
|
2022-08-10 22:57:46 +00:00
|
|
|
local buildForArch(arch) = {
|
2022-08-11 07:31:55 +00:00
|
|
|
name: getStepName(arch),
|
2022-08-11 21:11:55 +00:00
|
|
|
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
|
|
|
|
volumes: [{
|
|
|
|
name: 'dockersock',
|
|
|
|
path: '/var/run',
|
|
|
|
}],
|
2022-08-11 07:31:55 +00:00
|
|
|
commands: [
|
|
|
|
'echo Hello World from Jsonnet on ' + arch + '!',
|
2022-08-11 21:14:43 +00:00
|
|
|
'while ! docker image ls; do sleep 1; done',
|
2022-08-11 21:43:10 +00:00
|
|
|
'cross build --release --target ' + arch,
|
2022-08-11 21:11:55 +00:00
|
|
|
'ls -lah target' + arch + '/release',
|
2022-08-11 07:31:55 +00:00
|
|
|
],
|
2022-08-11 21:30:14 +00:00
|
|
|
environment: {
|
|
|
|
CROSS_REMOTE: true,
|
|
|
|
},
|
2022-08-10 22:58:45 +00:00
|
|
|
};
|
2022-08-11 07:31:55 +00:00
|
|
|
|
|
|
|
local check_steps() = [
|
|
|
|
buildForArch(a)
|
|
|
|
for a in archs
|
|
|
|
];
|
|
|
|
|
2022-08-10 22:46:48 +00:00
|
|
|
{
|
2022-08-11 07:31:55 +00:00
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: 'default',
|
|
|
|
platform: {
|
|
|
|
arch: 'amd64',
|
|
|
|
},
|
|
|
|
steps:
|
2022-08-11 21:11:55 +00:00
|
|
|
check_steps() +
|
|
|
|
[
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: 'rust:1.62',
|
|
|
|
commands: [
|
|
|
|
'ls -lah target/',
|
|
|
|
],
|
2022-08-11 21:39:27 +00:00
|
|
|
// depends_on: [getStepName(a) for a in archs],
|
2022-08-11 21:11:55 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
services: [{
|
|
|
|
name: 'docker',
|
|
|
|
image: 'docker:dind',
|
|
|
|
privileged: true,
|
|
|
|
volumes: [{
|
|
|
|
name: 'dockersock',
|
|
|
|
path: '/var/run',
|
2022-08-11 07:31:55 +00:00
|
|
|
}],
|
2022-08-11 21:11:55 +00:00
|
|
|
}],
|
|
|
|
|
|
|
|
volumes: [{
|
|
|
|
name: 'dockersock',
|
|
|
|
temp: {},
|
|
|
|
}],
|
2022-08-11 21:30:14 +00:00
|
|
|
|
|
|
|
image_pull_secrets: ['docker_private_repo'],
|
2022-08-11 07:31:55 +00:00
|
|
|
}
|