mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
f2a6683a97
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
40 lines
1022 B
Bash
Executable File
40 lines
1022 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Absolute path to the toplevel milvus directory.
|
|
toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)")
|
|
|
|
if [[ -f "$toplevel/.env" ]]; then
|
|
export $(cat $toplevel/.env | xargs)
|
|
fi
|
|
|
|
export OS_NAME="${OS_NAME:-ubuntu20.04}"
|
|
|
|
pushd "${toplevel}"
|
|
|
|
if [[ "${1-}" == "pull" ]]; then
|
|
docker-compose pull --ignore-pull-failures builder
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "${1-}" == "down" ]]; then
|
|
docker-compose down
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-go-mod"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-vscode-extensions"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-conan"
|
|
chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}"
|
|
|
|
docker-compose pull --ignore-pull-failures builder
|
|
if [[ "${CHECK_BUILDER:-}" == "1" ]]; then
|
|
docker-compose build builder
|
|
fi
|
|
|
|
docker-compose run --no-deps --rm builder "$@"
|
|
|
|
popd
|