I
I
Ilya Kozyrev2019-04-25 15:56:14
git
Ilya Kozyrev, 2019-04-25 15:56:14

How to change the user on behalf of which the pipeline starts in GitLab CI?

Good afternoon. Colleagues tell me please what could be the problem?
There is a local code repository where developers "commit" it, then a special service analyzes the repository and uploads each user's commit to GitLab. The upload occurs via ssh, and Deploy Keys is added to the GitLab server for the repository, with the help of which the push occurs. The commit service performs as follows

@ECHO OFF
set LOGFILE="D:\repos\test_ssh\dumps\git_log_ver_1.txt"
cd /D "D:\repos\test_ssh\test_ssh" >> %LOGFILE% 2>&1
set GIT_AUTHOR_DATE="2019-04-25 13:59:00"
set GIT_COMMITTER_DATE="2019-04-25 13:59:00"
set GIT_AUTHOR_NAME="Фамилия Имя Отчество"
set GIT_COMMITTER_NAME="Фамилия Имя Отчество"
set GIT_AUTHOR_EMAIL="<почта@домен.ru>"
set GIT_COMMITTER_EMAIL="<почта@домен.ru>"
rmdir /S /Q "D:\repos\test_ssh\test_ssh\SM\src\" >> %LOGFILE% 2>&1
for /d %%A in ("D:\repos\test_ssh\dumps\1\p\SM\*") do IF EXIST "D:\repos\test_ssh\test_ssh\SM\%%~nxA" ( robocopy "%%~A" "D:\repos\test_ssh\test_ssh\SM\%%~nxA" /E /MOVE /NFL /NDL /NJH /NJS /NC /NS /NP) ELSE ( move /y "%%~A" "D:\repos\test_ssh\test_ssh\SM\" ) >> %LOGFILE% 2>&1
move /y "D:\repos\test_ssh\dumps\1\p\SM\*" "D:\repos\test_ssh\test_ssh\SM\" >> %LOGFILE% 2>&1
git add --all ./ >> %LOGFILE% 2>&1
git commit -F "D:\repos\test_ssh\dumps\git_comment_1.txt" --allow-empty-message --cleanup=verbatim >> %LOGFILE% 2>&1
git gc --auto >> %LOGFILE% 2>&1

On the GitLab server with a commit, everything is OK. It's from the right author, and so on.
But for some reason, the pipeline always starts from my user, I attribute this to the fact that I added Deploy Keys under my account.
The inconvenience lies in the fact that when the pipeline falls, all notifications fall on me and not on the developer who made the commit.
Please tell me where to dig? how to drive it? It would be desirable that from whom commit - from that and the pipeline was launched.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-04-25
@WizaXxX

Messages always go to the user who launched the pipeline. There was a request for the functionality of sending notifications to commit authors, but it remained unrealized. Therefore, you will always receive these emails unless you create a global deployment token.
Regarding notifying commit authors, you can use a step with when: on_failure to send a notification

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question