-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
86 lines (79 loc) · 5.06 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# List all recipies
default:
just --list --unsorted
# Build pid binary
build-release-binary:
cargo build --target x86_64-unknown-linux-musl --release
# Build test container
test: build-release-binary
cp target/x86_64-unknown-linux-musl/release/pid1 ./pid1-exe/etc/
cd pid1-exe/etc && docker build . -f Dockerfile --tag pid1runner
# Test docker image
test-init-image:
docker run --rm --interactive --name pid pid1runner ps aux
docker run --rm --interactive --name pid pid1runner ls
docker run --rm --interactive --name pid pid1runner ls /
docker run --rm --interactive --name pid pid1runner id
docker run --rm --interactive --name pid pid1runner --workdir=/home pwd
docker run --rm --interactive --name pid pid1runner --env HELLO=WORLD --env=FOO=BYE printenv HELLO FOO
# Exec init image
exec-init-image:
docker run --rm --name pid --tty --interactive pid1runner sh
# Build binary for other architectures
binaries clean='false':
cross build --target x86_64-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/x86_64-unknown-linux-gnu:0.2.5
cross build --target aarch64-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5
cross build --target aarch64-unknown-linux-musl --release
-{{clean}} && docker image rm ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5
cross build --target arm-unknown-linux-musleabi --release
-{{clean}} && docker image rm ghcr.io/cross-rs/arm-unknown-linux-musleabi:0.2.5
cross build --target arm-unknown-linux-musleabihf --release
-{{clean}} && docker image rm ghcr.io/cross-rs/arm-unknown-linux-musleabihf:0.2.5
cross build --target armv5te-unknown-linux-musleabi --release
-{{clean}} && docker image rm ghcr.io/cross-rs/armv5te-unknown-linux-musleabi:0.2.5
cross build --target armv7-unknown-linux-musleabi --release
-{{clean}} && docker image rm ghcr.io/cross-rs/armv7-unknown-linux-musleabi:0.2.5
cross build --target armv7-unknown-linux-musleabihf --release
-{{clean}} && docker image rm ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5
cross build --target i586-unknown-linux-musl --release
-{{clean}} && docker image rm ghcr.io/cross-rs/i586-unknown-linux-musl:0.2.5
cross build --target i686-unknown-linux-musl --release
-{{clean}} && docker image rm ghcr.io/cross-rs/i686-unknown-linux-musl:0.2.5
cross build --target mips64-unknown-linux-muslabi64 --release
-{{clean}} && docker image rm ghcr.io/cross-rs/mips64-unknown-linux-muslabi64:0.2.5
cross build --target mips64el-unknown-linux-muslabi64 --release
-{{clean}} && docker image rm ghcr.io/cross-rs/mips64el-unknown-linux-muslabi64:0.2.5
cross build --target powerpc-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/powerpc-unknown-linux-gnu:0.2.5
cross build --target powerpc64-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/powerpc64-unknown-linux-gnu:0.2.5
cross build --target powerpc64le-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/powerpc64le-unknown-linux-gnu:0.2.5
cross build --target riscv64gc-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:0.2.5
cross build --target s390x-unknown-linux-gnu --release
-{{clean}} && docker image rm ghcr.io/cross-rs/s390x-unknown-linux-gnu:0.2.5
# Copy binaries to artifacts directory
cp-binaries:
mkdir -p artifacts
cp target/x86_64-unknown-linux-musl/release/pid1 ./artifacts/pid1-x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-gnu/release/pid1 ./artifacts/pid1-x86_64-unknown-linux-gnu
cp target/aarch64-unknown-linux-gnu/release/pid1 ./artifacts/pid1-aarch64-unknown-linux-gnu
cp target/aarch64-unknown-linux-musl/release/pid1 ./artifacts/pid1-aarch64-unknown-linux-musl
cp target/arm-unknown-linux-musleabi/release/pid1 ./artifacts/pid1-arm-unknown-linux-musleabi
cp target/arm-unknown-linux-musleabihf/release/pid1 ./artifacts/pid1-arm-unknown-linux-musleabihf
cp target/armv5te-unknown-linux-musleabi/release/pid1 ./artifacts/pid1-armv5te-unknown-linux-musleabi
cp target/armv7-unknown-linux-musleabi/release/pid1 ./artifacts/pid1-armv7-unknown-linux-musleabi
cp target/armv7-unknown-linux-musleabihf/release/pid1 ./artifacts/pid1-armv7-unknown-linux-musleabihf
cp target/i586-unknown-linux-musl/release/pid1 ./artifacts/pid1-i586-unknown-linux-musl
cp target/i686-unknown-linux-musl/release/pid1 ./artifacts/pid1-i686-unknown-linux-musl
cp target/mips64-unknown-linux-muslabi64/release/pid1 ./artifacts/pid1-mips64-unknown-linux-muslabi64
cp target/mips64el-unknown-linux-muslabi64/release/pid1 ./artifacts/pid1-mips64el-unknown-linux-muslabi64
cp target/powerpc-unknown-linux-gnu/release/pid1 ./artifacts/pid1-powerpc-unknown-linux-gnu
cp target/powerpc64-unknown-linux-gnu/release/pid1 ./artifacts/pid1-powerpc64-unknown-linux-gnu
cp target/powerpc64le-unknown-linux-gnu/release/pid1 ./artifacts/pid1-powerpc64le-unknown-linux-gnu
cp target/riscv64gc-unknown-linux-gnu/release/pid1 ./artifacts/pid1-riscv64gc-unknown-linux-gnu
cp target/s390x-unknown-linux-gnu/release/pid1 ./artifacts/pid1-s390x-unknown-linux-gnu
file artifacts/*