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

[WIP] Auto Release

parent b5d51ebd
Branches
Tags
No related merge requests found
Pipeline #16531 failed
priv
......@@ -23,6 +23,7 @@ test:
- echo $CI_DEPLOY_PASSWORD
- echo $GITLAB_USER_LOGIN
- echo $CI_COMMIT_REF_NAME
- echo $MY_TOKEN
- echo $(date '+%Y%m%d')
......@@ -39,24 +40,28 @@ build:
paths:
- README.pdf
deploy_to_release:
create_release:
stage: deploy
except:
- tags
- pdf@idevelop/howtogitlabrunner
script:
- ls -al *
- git clone git@gitlab.epfl.ch:idevelop/howtogitlabrunner.wiki.git wiki
- cp README.pdf wiki/public/
- echo \n$(date '+%Y-%m-%d %H:%M:%S') >> wiki/home.md
- cd wiki
# - git clone git@gitlab.epfl.ch:idevelop/howtogitlabrunner.wiki.git wiki
# - cp README.pdf wiki/public/
# - echo \n$(date '+%Y-%m-%d %H:%M:%S') >> wiki/home.md
# - cd wiki
- git config user.email "gitlab@epfl.ch"
- git config user.name "gitlab-runner"
- 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
# - git tag -f -a -m "My sweet release" v0.1
# - git push -f --tags
# - 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')
- git tag -f -a -m "My sweet release $(date '+%Y-%m-%d %H:%M:%S')" ${RELEASE_V}
- git push -f --tags
- 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)
- 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"
deploy_to_production:
stage: deploy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment