-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_all.sh
More file actions
executable file
·27 lines (21 loc) · 1.26 KB
/
Copy pathbuild_all.sh
File metadata and controls
executable file
·27 lines (21 loc) · 1.26 KB
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
#!/bin/sh
rm -rf build dist specs
user_id=$(id -u)
group_id=$(id -g)
cur_dir=$(pwd)
# Local OS setup
distro=$(uname | tr '[:upper:]' '[:lower:]')
arch=$(uname -m)
if [ "$arch" = "arm64" ]; then
arch="aarch64"
elif [ "$arch" = "x86_64" ]; then
arch="x86_64"
else
arch=unknown
fi
uv sync
uv run pyallel "docker build --tag pyallel-x86_64 --build-arg 'arch=x86_64' --build-arg 'uid=$user_id' --build-arg 'gid=$group_id' . && docker run -e 'arch=x86_64' --rm --volume '$cur_dir:/src' pyallel-x86_64" :: \
"docker build --tag pyallel-aarch64 --build-arg 'arch=aarch64' --build-arg 'uid=$user_id' --build-arg 'gid=$group_id' . && docker run -e 'arch=aarch64' --rm --volume '$cur_dir:/src' pyallel-aarch64" :: \
"docker build --tag pyallel-x86_64-alpine --build-arg 'arch=x86_64' --build-arg 'uid=$user_id' --build-arg 'gid=$group_id' --file Dockerfile.alpine . && docker run -e 'arch=x86_64' --rm --volume '$cur_dir:/src' pyallel-x86_64-alpine" :: \
"docker build --tag pyallel-aarch64-alpine --build-arg 'arch=aarch64' --build-arg 'uid=$user_id' --build-arg 'gid=$group_id' --file Dockerfile.alpine . && docker run -e 'arch=aarch64' --rm --volume '$cur_dir:/src' pyallel-aarch64-alpine" :: \
"source .venv/bin/activate && ./build.sh $distro $arch"