t
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/tag Build is passing Details

pull/4/head
dmitry.kirdyashkin 2023-07-22 02:01:18 +03:00
parent 0accd0db53
commit ed0b3fb15d
1 changed files with 8 additions and 0 deletions

8
lib
View File

@ -18,6 +18,7 @@ function create-release(){
RELEASE_LIST=$(curl -X GET -Url https://gitea.kdiva.ru/api/v1/repos/modules/sc-items/releases) RELEASE_LIST=$(curl -X GET -Url https://gitea.kdiva.ru/api/v1/repos/modules/sc-items/releases)
LATEST_RELEASE_ID=$(jq -r '.[] | select(.tag_name=="latest") | .id' <<< $RELEASE_LIST) LATEST_RELEASE_ID=$(jq -r '.[] | select(.tag_name=="latest") | .id' <<< $RELEASE_LIST)
delete-release $LATEST_RELEASE_ID delete-release $LATEST_RELEASE_ID
delete-tag
fi fi
RESPONSE=$(curl \ RESPONSE=$(curl \
@ -54,6 +55,13 @@ function delete-release(){
-H 'Authorization: Bearer 10e4af53e553aacb905766512e36487492d61a66' -H 'Authorization: Bearer 10e4af53e553aacb905766512e36487492d61a66'
} }
function delete-tag(){
curl \
-X 'DELETE' \
-Url "https://gitea.kdiva.ru/api/v1/repos/${DRONE_REPO}/tags/latest" \
-H 'Authorization: Bearer 10e4af53e553aacb905766512e36487492d61a66'
}
function vars() { function vars() {
echo "DRONE_SEMVER $DRONE_SEMVER" echo "DRONE_SEMVER $DRONE_SEMVER"
echo "DRONE_REPO_LINK $DRONE_REPO_LINK" echo "DRONE_REPO_LINK $DRONE_REPO_LINK"