Skip to content
Snippets Groups Projects
Commit c9eb00a7 authored by Nicolas Borboën's avatar Nicolas Borboën
Browse files

[WIP} is WIP

- Fix expansion bug(s)
- Constantize PROJECT_ID
- Remove unused exports
parent be88e6bc
No related branches found
No related tags found
Loading
Pipeline #16548 waiting for manual action
#!/usr/bin/env bash
PROJECT_ID=1298
set -e -x
env
......@@ -27,7 +29,7 @@ whoami
# git commit -am "New PDF file $(date '+%Y-%m-%d %H:%M:%S')"
# git push --push-option=ci.skip origin master
# https://docs.gitlab.com/ee/ci/yaml/README.html#skipping-jobs
export RELEASE_V=v$(date '+%s')
RELEASE_V=v$(date '+%s')
echo "Creating release: ${RELEASE_V}"
git tag -f -a -m "My sweet release $(date '+%Y-%m-%d %H:%M:%S')" ${RELEASE_V}
echo "END OF TAGGING"
......@@ -36,7 +38,7 @@ git push -f --tags
echo "END OF PUSH"
echo "BEGIN UPLOAD"
export UPLOADED_FILE_URL=$(curl --request POST --header "Private-Token: ${MY_TOKEN}" --form "file=@README.pdf" "https://gitlab.epfl.ch/api/v4/projects/1298/uploads" | jq .url)
UPLOADED_FILE_URL="$(curl --request POST --header "Private-Token: ${MY_TOKEN}" --form "file=@README.pdf" "https://gitlab.epfl.ch/api/v4/projects/1298/uploads" | jq .url)"
echo "END UPLOAD"
echo "BEGIN POST RELEASE"
......@@ -44,8 +46,8 @@ for retry in $(seq 1 5); do
if curl --request POST \
--header 'Content-Type: application/json' \
--header "Private-Token: ${MY_TOKEN}" \
--data '{"name": "New README release", "tag_name": "${RELEASE_V}", "description": "Release with the PDF [README.pdf](${UPLOADED_FILE_URL})"}' \
"https://gitlab.epfl.ch/api/v4/projects/1298/releases" \
--data '{"name": "New README release", "tag_name": "'${RELEASE_V}'", "description": "Release with the PDF [README.pdf]('${UPLOADED_FILE_URL}')"}' \
"https://gitlab.epfl.ch/api/v4/projects/'${PROJECT_ID}'/releases" \
| jq -e ".created_at"
then
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment