feat: setup script to sync repos #114
1 changed files with 2 additions and 3 deletions
|
@ -17,14 +17,13 @@ Mirror-Create(){
|
|||
# make sure the values are clean of extra characters
|
||||
local ID=${1}
|
||||
local REPO_TMP=$(tr -d '\n\t\r ' <<<"${2}" )
|
||||
local token=$(tr -d '\n\t\r ' <<<"$TOKEN" )
|
||||
local REPO=${REPO_TMP#"https://"}
|
||||
|
||||
local body="url=https://oauth2:$token@$REPO&enabled=true&only_protected_branches=false&keep_divergent_refs=false"
|
||||
local body="url=https://oauth2:$TOKEN_REMOTE@$REPO&enabled=true&only_protected_branches=false&keep_divergent_refs=false"
|
||||
local uri="https://gitlab.skynet.ie/api/v4/projects/$id/remote_mirrors"
|
||||
echo $uri
|
||||
local tmp=""
|
||||
curl -sS -X "POST" "$uri" --header "PRIVATE-TOKEN: $token" --data $body > tmp
|
||||
curl -sS -X "POST" "$uri" --header "PRIVATE-TOKEN: $TOKEN" --data $body > tmp
|
||||
}
|
||||
|
||||
Main() {
|
||||
|
|
Loading…
Reference in a new issue