This commit is contained in:
Semyon Bezrukov 2024-09-11 17:42:14 +03:00
parent 180496fde6
commit 59752f6b7a

6
Jenkinsfile vendored
View File

@ -358,7 +358,7 @@ def printBranches(String repo) {
return sh (
label: "${repo}: branches list",
script: """
curl -sv -X 'GET' \
curl -s -X 'GET' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branches' \
-H 'accept: application/json' \
-H 'Authorization: '"\$GITEA_TOKEN" | \
@ -375,7 +375,7 @@ def protectBranch(String repo, String branch) {
echo '{
"branch_name": "master"
}' | \
curl -sv -X 'POST' \
curl -s -X 'POST' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections' \
-H 'accept: application/json' \
-H 'Authorization: token '"\$GITEA_TOKEN" \
@ -390,7 +390,7 @@ def unprotectBranch(String repo, String branch) {
return sh (
label: "${repo}: unprotect ${branch}",
script: """
curl -sv -X 'DELETE' \
curl -s -X 'DELETE' \
'https://'"\$GIT_SERVER"'/api/v1/repos/${repo}/branch_protections/${branch}' \
-H 'accept: application/json' \
-H 'Authorization: token '"\$GITEA_TOKEN"