Switch mac client install to tarball download
This commit is contained in:
@@ -34,7 +34,7 @@ export function affectedComponents(files) {
|
||||
else if (/^(src\/web\/|public\/|index\.html$|vite\.config\.js$)/.test(file)) {
|
||||
add('macClient', 'gatewayClient');
|
||||
} else if (/^src\/server\//.test(file)) add('macClient', 'gatewayBackend');
|
||||
else if (/^(Dockerfile\.client|docker-compose\.client(\.local)?\.yml|entrypoint\.client\.sh|scripts\/(install-macos-client|harbor-network-monitor)\.sh)$/.test(file)) {
|
||||
else if (/^(install\.sh|Dockerfile\.client|docker-compose\.client(\.local)?\.yml|entrypoint\.client\.sh|scripts\/(install-macos-client|harbor-network-monitor)\.sh)$/.test(file)) {
|
||||
add('macClient');
|
||||
} else if (/^(Dockerfile|Dockerfile\.runtime-base|docker-compose\.gateway\.yml|entrypoint\.sh|scripts\/(deploy-gateway|build-runtime-base|build-on-107-deploy-111)\.sh)$/.test(file)) {
|
||||
add('gatewayBackend');
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
INSTALL_DIR="${VPN_PROXY_INSTALL_DIR:-$HOME/.vpn-proxy-client}"
|
||||
REPO_URL="${VPN_PROXY_REPO_URL:-https://git.dokops.ru/dokril/vpn-proxy.git}"
|
||||
BRANCH="${VPN_PROXY_BRANCH:-master}"
|
||||
ARCHIVE_URL="${VPN_PROXY_ARCHIVE_URL:-https://git.dokops.ru/dokril/vpn-proxy/archive/${BRANCH}.tar.gz}"
|
||||
SOURCE_DIR="${VPN_PROXY_SOURCE_DIR:-}"
|
||||
COMPOSE_FILE="docker-compose.client.yml"
|
||||
DEFAULT_PROXY_PORT="8082"
|
||||
REQUESTED_PROXY_PORT="${VPN_PROXY_CLIENT_PORT:-}"
|
||||
@@ -254,26 +255,49 @@ get_env_value() {
|
||||
' .env
|
||||
}
|
||||
|
||||
copy_source() {
|
||||
local source_dir="$1"
|
||||
[ -f "$source_dir/docker-compose.client.yml" ] || die "invalid Harbor source archive"
|
||||
log "installing files to $INSTALL_DIR"
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
cp -R "$source_dir/." "$INSTALL_DIR/"
|
||||
}
|
||||
|
||||
download_source() {
|
||||
local tmp_dir
|
||||
tmp_dir="$(mktemp -d)"
|
||||
mkdir -p "$tmp_dir/source"
|
||||
log "downloading $ARCHIVE_URL"
|
||||
if ! curl -fsSL "$ARCHIVE_URL" | tar -xzf - -C "$tmp_dir/source" --strip-components=1; then
|
||||
rm -rf "$tmp_dir"
|
||||
die "failed to download Harbor source"
|
||||
fi
|
||||
copy_source "$tmp_dir/source"
|
||||
rm -rf "$tmp_dir"
|
||||
}
|
||||
|
||||
if [[ "$(uname -s)" != "Darwin" ]]; then
|
||||
die "this installer is intended for macOS"
|
||||
fi
|
||||
|
||||
need git
|
||||
need docker
|
||||
need curl
|
||||
need tar
|
||||
|
||||
docker compose version >/dev/null 2>&1 || die "Docker Compose plugin is required"
|
||||
docker info >/dev/null 2>&1 || die "Docker Desktop is not running"
|
||||
|
||||
if [[ -d "$INSTALL_DIR/.git" ]]; then
|
||||
if [[ -n "$SOURCE_DIR" ]]; then
|
||||
copy_source "$SOURCE_DIR"
|
||||
elif [[ -d "$INSTALL_DIR/.git" ]]; then
|
||||
need git
|
||||
log "updating $INSTALL_DIR"
|
||||
git -C "$INSTALL_DIR" fetch origin "$BRANCH"
|
||||
git -C "$INSTALL_DIR" checkout "$BRANCH"
|
||||
git -C "$INSTALL_DIR" pull --ff-only origin "$BRANCH"
|
||||
else
|
||||
log "cloning $REPO_URL#$BRANCH to $INSTALL_DIR"
|
||||
mkdir -p "$(dirname "$INSTALL_DIR")"
|
||||
git clone --branch "$BRANCH" "$REPO_URL" "$INSTALL_DIR"
|
||||
download_source
|
||||
fi
|
||||
|
||||
cd "$INSTALL_DIR"
|
||||
|
||||
Reference in New Issue
Block a user