Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question