kas: add GIT_CREDENTIAL_HELPER environment variable

This allows to set a git credential helper in the .gitconfig, in order
to handle git authentications. For instance when bitbake recipes require
to clone from git via https.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Claudius Heine 2021-05-06 11:31:12 +02:00 committed by Jan Kiszka
parent b250c341fb
commit 71e7f5523d
2 changed files with 9 additions and 0 deletions

View File

@ -68,5 +68,9 @@ Environment variables
| ``AWS_CONFIG_FILE`` | Path to the awscli configuration and credentials |
| |aws_cred| | file that are copied to the kas home dir. |
+-----------------------+-----------------------------------------------------+
| |git_cred| | Allows to set the git credential helper in the |
| | `.gitconfig` of the kas user. |
+-----------------------+-----------------------------------------------------+
.. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE``
.. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER``

View File

@ -164,6 +164,11 @@ class SetupHome(Command):
fds.write('[User]\n'
'\temail = kas@example.com\n'
'\tname = Kas User\n')
if os.environ.get('GIT_CREDENTIAL_HELPER', False):
fds.write('[credential]\n'
'\thelper = '
+ os.environ.get('GIT_CREDENTIAL_HELPER')
+ '\n')
if os.environ.get('AWS_CONFIG_FILE', False) \
and os.environ.get('AWS_SHARED_CREDENTIALS_FILE', False):