-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d49ffd
commit fe9866b
Showing
3 changed files
with
25 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,23 +14,27 @@ usage() { | |
echo "" | ||
echo "OPTIONS" | ||
echo " -h, --help Show this help message and exit." | ||
echo " --arch Specify the target architecture (default: uname -m)." | ||
echo " --clean Run 'make clean' instead of 'make'." | ||
echo " --force-cmake Force to re-run cmake to refresh build scripts." | ||
} | ||
|
||
arch=$(uname -m) | ||
|
||
while [ $# -gt 0 ]; do | ||
case $1 in | ||
-h | --help) usage; exit 1 ;; | ||
--force-cmake) FORCE_CMAKE=1 ;; | ||
--clean) CLEAN=1 ;; | ||
--arch) shift; arch=$1 ;; | ||
*) | ||
break | ||
esac | ||
shift | ||
done | ||
|
||
distro="$1" | ||
arch="$(uname -m)" | ||
|
||
case $distro in | ||
ubuntu22.04) | ||
distro="ubuntu" | ||
|
@@ -56,7 +60,15 @@ user="$(id -u):$(id -g)" | |
# to prevent "fatal: unable to look up current user in the passwd file: no such user" error from git | ||
git_fix="-e GIT_COMMITTER_NAME=devops -e [email protected]" | ||
|
||
docker build -t lablup/hook-dev:${distro_ver} -f Dockerfile.${distro_ver} . | ||
if [ "$arch" = "aarch64" ]; then | ||
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json | ||
sudo systemctl restart docker | ||
|
||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
fi | ||
|
||
docker build --platform=linux/${arch} -t lablup/hook-dev:${distro_ver} -f Dockerfile.${distro_ver} . | ||
|
||
docker_run="docker run --rm ${git_fix} -v "$(pwd):/root" -u ${user} -w=/root lablup/hook-dev:${distro_ver} /bin/sh -c" | ||
|
||
if [ "$FORCE_CMAKE" -eq 1 -o ! -f "Makefile" ]; then | ||
|