diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc5bc8e11100dc851cd838377addf5d8c7230c94..520208c4abb56648b1928f091c7ed8c127917af8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ create_release: - pdf@idevelop/howtogitlabrunner script: - ls -al * - - MY_TOKEN=$MY_TOKEN sh deploy.sh $MY_TOKEN + - sh deploy.sh deploy_to_production: stage: deploy diff --git a/deploy.sh b/deploy.sh index d0bdc8c9273a5ac04b43f1a1d29746aae18caf68..2c4e2bce11814e299727266a4a279a5cf8966491 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,22 +7,20 @@ echo $MY_TOKEN echo "Hello from deploy.sh" -echo $1 # -# # - 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 +# 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 -# - 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 -# - 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) -# - 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" -# -# +# 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 +# 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) +# 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" +# #