BM3
This commit is contained in:
parent
f08e80f131
commit
7247dbe4a4
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -358,7 +358,7 @@ def printBranches(String repo) {
|
|||||||
return sh (
|
return sh (
|
||||||
label: "${repo}: branches list",
|
label: "${repo}: branches list",
|
||||||
script: """
|
script: """
|
||||||
curl -sv -f -X 'GET' \
|
curl -sv -X 'GET' \
|
||||||
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branches' \
|
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branches' \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'Authorization: '"\$GITEA_TOKEN" | \
|
-H 'Authorization: '"\$GITEA_TOKEN" | \
|
||||||
@ -375,7 +375,7 @@ def protectBranch(String repo, String branch) {
|
|||||||
echo '{
|
echo '{
|
||||||
"branch_name": "master"
|
"branch_name": "master"
|
||||||
}' | \
|
}' | \
|
||||||
curl -sv -f -X 'POST' \
|
curl -sv -X 'POST' \
|
||||||
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections' \
|
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections' \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'Authorization: '"\$GITEA_TOKEN" \
|
-H 'Authorization: '"\$GITEA_TOKEN" \
|
||||||
@ -390,7 +390,7 @@ def unprotectBranch(String repo, String branch) {
|
|||||||
return sh (
|
return sh (
|
||||||
label: "${repo}: unprotect ${branch}",
|
label: "${repo}: unprotect ${branch}",
|
||||||
script: """
|
script: """
|
||||||
curl -sv -f -X 'DELETE' \
|
curl -sv -X 'DELETE' \
|
||||||
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}' \
|
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}' \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'Authorization: '"\$GITEA_TOKEN"
|
-H 'Authorization: '"\$GITEA_TOKEN"
|
||||||
|
Loading…
Reference in New Issue
Block a user