-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_all.sh
executable file
·28 lines (22 loc) · 1.25 KB
/
build_all.sh
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
#!/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
poetry install
poetry 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" \
::: \
"./build.sh $distro $arch"