Hi !
I am using GitLab with my company. We are developing very interesting things in our C++ library (that’s just my opinion :p) and GitLab helped a lot to implement a continuous integration process. We already use it in order to:
- Build & Test our library in Debug mode
- Build & Test our library in Release mode
- Check if there are any memory leaks
- Check if some symbols are here while they shouldn’t
- Generate documentation
- …
Lately we have been thinking about adding a profiling stage to those process so we can see how our optimization works are influencing the performance of the library. We want it a bit like our documentation generation, a GitLab runner is responsible to push the modifications (i.e. the documentation or the benchmarks) in the relevant project.
We already made this using the SSH key method but for our benchmarks we would like to avoid that and use existing GitLab variables for that.
Here are the stage details:
test_ci_push:
tags:
- linux
- shell
- light
stage: profiling
allow_failure: false
only:
- new-benchmark-stage
script:
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.mycompany.home/developers/benchmarks.git &> /dev/null
- cd benchmarks
- touch test.dat
- echo "This is a test" > test.dat
- git config --global user.name "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git add --all
- git commit -m "Uploader"
- git push http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.mycompany.home/developers/benchmarks.git HEAD:master
- cd ..
It works well until the push
step. Even if I try different techniques to push new files (i.e. git push origin master
) I always have the same error:
remote: You are not allowed to upload code for this project.
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.mycompany.home/developers/benchmarks.git/': The requested URL returned error: 403
I am the owner of the project and the master branch is unprotected.
What am I doing wrong here ?