Skip to content
Snippets Groups Projects
Commit b4dbab0b authored by Martin Beseda's avatar Martin Beseda
Browse files

[NEW] Added Bash scripts providing easy-to-use interface to add and delete releases.

parent 8cbb6fe8
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
PROJECT_ID=$1
TAG_NAME=$2
PRIVATE_TOKEN=$3
if [ "$3" == "" ]; then
echo "Missing parameter! Parameters are PROJECT_ID, TAG_NAME and PRIVATE_TOKEN.";
exit 1;
fi
curl --request DELETE --header "Private-Token: ${PRIVATE_TOKEN}" "https://code.it4i.cz/api/v4/projects/${PROJECT_ID}/releases/${TAG_NAME}"
echo
#!/bin/bash
RELEASE_NAME="$1"
TAG_NAME="$2"
PROJECT_ID="$3"
DESCRIPTION_FILE_PATH="$4"
PRIVATE_TOKEN="$5"
if [ "$5" == "" ]; then
echo "Missing parameter! Parameters are RELEASE_NAME, TAG_NAME, PROJECT_ID, DESCRIPTION_FILE_PATH and PRIVATE_TOKEN.";
exit 1;
fi
DESCRIPTION=''
# Load data from file
while read -r line; do
DESCRIPTION="${DESCRIPTION}${line}\n";
done < "${DESCRIPTION_FILE_PATH}"
echo $DESCRIPTION
curl --request POST\
--header 'Content-Type: application/json'\
--header "Private-Token: ${PRIVATE_TOKEN}"\
--data-binary "{\"name\": \"${RELEASE_NAME}\", \"tag_name\": \"${TAG_NAME}\", \"description\": \"${DESCRIPTION}\"}"\
"https://code.it4i.cz/api/v4/projects/${PROJECT_ID}/releases"
echo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment