mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
general build.
This commit is contained in:
parent
733cd55c3c
commit
2b90d42f75
43
.m1k1o/build
43
.m1k1o/build
@ -1,45 +1,36 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
BASE=../
|
BASE="${PWD}/../"
|
||||||
|
IMAGE="m1k1o/neko"
|
||||||
|
|
||||||
build_client() {
|
build_client() {
|
||||||
docker build -t neko-dev-client -f base/Dockerfile --target client "$BASE"
|
docker build -t neko-dev-client -f base/Dockerfile --target client "${BASE}"
|
||||||
docker run --rm -v "$BASE"/client/dist:/tmp/dist neko-dev-client sh -c "rm -rf /tmp/dist/*; cp -r /src/dist/* /tmp/dist"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_server() {
|
build_server() {
|
||||||
docker build -t neko-dev-server -f base/Dockerfile --target server "$BASE"
|
docker build -t neko-dev-server -f base/Dockerfile --target server "${BASE}"
|
||||||
docker run --rm -v "$BASE"/server/bin:/tmp/bin neko-dev-server sh -c "rm -rf /tmp/bin/neko; cp /src/bin/neko /tmp/bin"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_base() {
|
build_base() {
|
||||||
docker build -t m1k1o/neko:base -f base/Dockerfile "$BASE"
|
docker build -t "${IMAGE}:base" -f base/Dockerfile "${BASE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_firefox() {
|
build() {
|
||||||
docker build -t m1k1o/neko:firefox -f firefox/Dockerfile firefox/
|
docker build -t "${IMAGE}:$1" -f "$1/Dockerfile" "$1/"
|
||||||
}
|
|
||||||
|
|
||||||
build_chromium() {
|
|
||||||
docker build -t m1k1o/neko:chromium -f chromium/Dockerfile chromium/
|
|
||||||
}
|
|
||||||
|
|
||||||
build_xfce() {
|
|
||||||
docker build -t m1k1o/neko:xfce -f xfce/Dockerfile xfce/
|
|
||||||
}
|
|
||||||
|
|
||||||
build_vlc() {
|
|
||||||
docker build -t m1k1o/neko:vlc -f vlc/Dockerfile vlc/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
client) build_client;;
|
client) build_client;;
|
||||||
serve) build_server;;
|
server) build_server;;
|
||||||
base) build_base;;
|
base) build_base;;
|
||||||
firefox) build_firefox;;
|
*) build "$1";;
|
||||||
chromium) build_chromium;;
|
|
||||||
xfce) build_xfce;;
|
|
||||||
vlc) build_vlc;;
|
|
||||||
*) echo "Unknown $1";;
|
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user