常规升级
This commit is contained in:
Vendored
+7
-7
@@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
cd "$root"
|
cd "$root"
|
||||||
|
origin="$(git remote get-url origin)"
|
||||||
|
origin="${origin%/}"
|
||||||
|
remote_root="$(printf '%s\n' "$origin" | sed -E 's#/[^/]+(\.git)?$##')"
|
||||||
fetch_repo() {
|
fetch_repo() {
|
||||||
local repo="$1"
|
local repo="$1"
|
||||||
local branch="$2"
|
local branch="$2"
|
||||||
@@ -17,14 +19,12 @@ fetch_repo() {
|
|||||||
git clone --branch "$branch" --single-branch "$repo" "$dir"
|
git clone --branch "$branch" --single-branch "$repo" "$dir"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_repo_ex() {
|
fetch_repo_ex() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
repo="http://192.168.1.75:3000/psc/${name}"
|
local repo="${remote_root}/${name}"
|
||||||
branch="master"
|
local branch="master"
|
||||||
fetch_repo "${repo}" "$branch" "third_party/${name}"
|
fetch_repo "$repo" "$branch" "third_party/${name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_repo_ex "build_infra"
|
fetch_repo_ex "build_infra"
|
||||||
fetch_repo_ex "CPP_Core"
|
fetch_repo_ex "CPP_Core"
|
||||||
fetch_repo_ex "SSR"
|
fetch_repo_ex "SSR"
|
||||||
Vendored
+4
-1
@@ -6,6 +6,9 @@ if ( [string]::IsNullOrWhiteSpace($scriptDir))
|
|||||||
}
|
}
|
||||||
$root = (Resolve-Path -LiteralPath (Join-Path $scriptDir "..")).Path
|
$root = (Resolve-Path -LiteralPath (Join-Path $scriptDir "..")).Path
|
||||||
Set-Location -LiteralPath $root
|
Set-Location -LiteralPath $root
|
||||||
|
$origin = git remote get-url origin
|
||||||
|
$origin = $origin.TrimEnd("/")
|
||||||
|
$remoteRoot = $origin -replace "/[^/]+(\.git)?$", ""
|
||||||
function Fetch-Repo
|
function Fetch-Repo
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
@@ -31,7 +34,7 @@ function Fetch-RepoEx
|
|||||||
param(
|
param(
|
||||||
[string]$Name
|
[string]$Name
|
||||||
)
|
)
|
||||||
$repo = "http://10.10.10.1:3000/ae/$Name"
|
$repo = "$remoteRoot/$Name"
|
||||||
$branch = "master"
|
$branch = "master"
|
||||||
Fetch-Repo -Repo $repo -Branch $branch -Dir "third_party/$Name"
|
Fetch-Repo -Repo $repo -Branch $branch -Dir "third_party/$Name"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user