xen-troops / moulin

Moulin is meta build system that is capable of building multiple images at once
Apache License 2.0
2 stars 15 forks source link

fetchers: disable prompt usage by git #84

Closed rshym closed 11 months ago

rshym commented 11 months ago

This commit addresses issue with git interacting with the user through the console. For example, HTTPS access to the private repo. We use git inside the console, that is hidden from the user, so user see only hanging fetch.

So, we instruct the git to not interact with the user by the command GIT_TERMINAL_PROMPT=0. As result, git fails cloning and inform user that asking name/password is not possible. This should push the user to use script-friendly authorization, like ssh.

Suggested-by: Artem Mygaiev artem_mygaiev@epam.com

rshym commented 11 months ago

Tested with https access to the private repo.

FAILED: yocto/test 
GIT_SSH_COMMAND='ssh -o BatchMode=yes' GIT_TERMINAL_PROMPT=0 git clone -q https://github.com/rshym/test.git yocto/test && touch yocto/test
fatal: could not read Username for 'https://github.com': terminal prompts disabled
ninja: build stopped: subcommand failed.
rshym commented 11 months ago

Rebased on the latest changes.

lorc commented 11 months ago

Thanks Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

rshym commented 11 months ago

Ack is added. Tested. Ready to merge.