Verified Commit 3f59c3de authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

set deploy mechanism using token

parent c38709fc
# for your information
# we need to extract the ssh/git URL as the runner uses a tokenized URL
export CI_PUSH_REPO=`echo $CI_BUILD_REPO | perl -pe 's#.*@(.+?(\:\d+)?)/#git@\1:#'`
# runner runs on a detached HEAD, create a temporary local branch for editing
git checkout -b tmpBranch
git config --global "artenobot"
git config --global ""
git remote set-url --push origin "${CI_PUSH_REPO}"
# commit
git commit -am "Update models"
# push changes
# always return true so that the build does not fail if there are no changes
git push origin tmpBranch:${CI_BUILD_REF_NAME} || true
......@@ -18,5 +18,13 @@ commit:
- if: $CI_COMMIT_BRANCH == "build-ci"
- if: $CI_COMMIT_BRANCH == "master"
- url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
- git checkout -b $CI_COMMIT_REF_NAME
- git remote set-url origin "https://$GIT_ACCESS_USER:$GIT_ACCESS_PASSWORD@${url_host}"
- git config $GIT_ACCESS_USER
- git config $GIT_ACCESS_EMAIL
- sh .ci/
\ No newline at end of file
- git commit -am "Update models"
- git push origin $CI_COMMIT_REF_NAME
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment