neko/.m1k1o/build

48 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-06-17 10:32:34 +12:00
#!/bin/sh
2020-06-19 12:38:35 +12:00
cd "$(dirname "$0")"
2020-06-17 10:32:34 +12:00
2021-03-23 10:01:54 +13:00
BASE="${PWD}/../"
IMAGE="m1k1o/neko"
2020-06-17 10:32:34 +12:00
build_client() {
2021-03-23 10:01:54 +13:00
docker build -t neko-dev-client -f base/Dockerfile --target client "${BASE}"
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "${BASE}client/dist:/tmp/dist" \
neko-dev-client sh -c "rm -rf /tmp/dist/*; cp -r /src/dist/* /tmp/dist"
2020-06-17 10:32:34 +12:00
}
build_server() {
2021-03-23 10:01:54 +13:00
docker build -t neko-dev-server -f base/Dockerfile --target server "${BASE}"
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "${BASE}server/bin:/tmp/bin" \
neko-dev-server sh -c "rm -rf /tmp/bin/neko; cp /src/bin/neko /tmp/bin"
2021-03-29 22:27:28 +13:00
}
2020-06-17 10:32:34 +12:00
build_base() {
2021-03-23 10:01:54 +13:00
docker build -t "${IMAGE}:base" -f base/Dockerfile "${BASE}"
2021-03-29 22:27:28 +13:00
}
2021-03-30 10:09:09 +13:00
build_base_arm() {
docker build -t "${IMAGE}:base_arm" -f base_arm/Dockerfile "${BASE}"
2020-06-30 19:45:45 +12:00
}
2021-03-30 10:09:09 +13:00
build_firefox_arm() {
docker build -t "${IMAGE}:firefox_arm" -f firefox/Dockerfile --build-arg BASE_IMAGE="${IMAGE}:base_arm" firefox
2020-06-17 10:32:34 +12:00
}
2021-03-23 10:01:54 +13:00
build() {
docker build -t "${IMAGE}:$1" -f "$1/Dockerfile" "$1/"
}
2020-06-17 10:32:34 +12:00
case $1 in
client) build_client;;
2021-03-23 10:01:54 +13:00
server) build_server;;
2020-06-17 10:32:34 +12:00
base) build_base;;
2021-03-30 10:09:09 +13:00
base_arm) build_base_arm;;
firefox_arm) build_firefox_arm;;
2021-03-23 10:01:54 +13:00
*) build "$1";;
2020-06-17 10:32:34 +12:00
esac
2021-03-30 10:09:09 +13:00