2020-04-30 19:52:54 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
2020-08-28 03:39:24 +08:00
|
|
|
cd "$(dirname "$0")/../../.."
|
|
|
|
source ./ci/lib.sh
|
2020-09-15 22:15:51 +08:00
|
|
|
mkdir -p .home
|
2020-04-30 19:52:54 +08:00
|
|
|
|
|
|
|
docker run \
|
|
|
|
-it \
|
2020-08-28 03:39:24 +08:00
|
|
|
--rm \
|
|
|
|
-v "$PWD:/src" \
|
2020-09-15 22:15:51 +08:00
|
|
|
-e HOME="/src/.home" \
|
2020-09-15 22:41:47 +08:00
|
|
|
-e USER="coder" \
|
2020-10-07 02:19:04 +08:00
|
|
|
-e GITHUB_TOKEN \
|
2020-10-08 01:26:57 +08:00
|
|
|
-e KEEP_MODULES \
|
|
|
|
-e MINIFY \
|
2020-08-28 03:39:24 +08:00
|
|
|
-w /src \
|
|
|
|
-p 127.0.0.1:8080:8080 \
|
2020-09-03 14:16:57 +08:00
|
|
|
-u "$(id -u):$(id -g)" \
|
|
|
|
-e CI \
|
2020-09-15 22:41:47 +08:00
|
|
|
"$(docker_build ./ci/images/"${IMAGE-debian10}")" \
|
2020-08-28 03:39:24 +08:00
|
|
|
"$@"
|
2020-04-30 19:52:54 +08:00
|
|
|
}
|
|
|
|
|
2020-08-28 03:39:24 +08:00
|
|
|
docker_build() {
|
|
|
|
docker build "$@" >&2
|
|
|
|
docker build -q "$@"
|
2020-04-30 19:52:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|