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