[opensuse-buildservice] git login credentials for obs source services
Hi, I have a git host that requires logins and I want to use the obs_scm service without providing a url like user:login@host/... for every package. So I created a .gitconfig & .git-credentials file for the obsservicerun user in the obsservicerun home directory (/usr/lib/obs according to passwd) with read permissions but it seems that this file is not used by the service. If I execute the checkout command from src_service.log manually it works though. How should this be done? Do I use the wrong user account? I get this error service tar_scm failed: ERROR(128): "Cloning into '/srv/obs/service/11565/out/tmpLgoRio/testpackage'... fatal: could not read Username for 'http://giturl/foo': No such device or address <- if I use user@host, I get "could not read Password" instead " Traceback (most recent call last): File "/usr/lib/obs/service//tar_scm", line 30, in main() File "/usr/lib/obs/service//tar_scm", line 26, in main TarSCM.run() File "/usr/lib/obs/service/TarSCM/__init__.py", line 35, in run task_list.process_list() File "/usr/lib/obs/service/TarSCM/tasks.py", line 116, in process_list self.process_single_task(task) File "/usr/lib/obs/service/TarSCM/tasks.py", line 184, in process_single_task scm_object.fetch_upstream() File "/usr/lib/obs/service/TarSCM/scm/base.py", line 90, in fetch_upstream self.fetch_upstream_scm() File "/usr/lib/obs/service/TarSCM/scm/git.py", line 91, in fetch_upstream_scm <- that basically executes git clone <what> <where> os.removedirs(os.path.join(wdir, self.clone_dir)) File "/usr/lib64/python2.7/os.py", line 170, in removedirs rmdir(name) OSError: [Errno 2] No such file or directory: '/srv/obs/service/11565/out/tmpLgoRio/testpackage' Regards, Mark -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
ok, I found the problem. The service has no $HOME and so it will never find the git global configuration. If I add def _get_scm_cmd(self): os.environ["HOME"] = "/usr/lib/obs" .... then it works as expected. Not having a home may be by design though, so I will report it in the github project and see what happens. Regards, Mark -----Ursprüngliche Nachricht----- Von: Morschhäuser, Mark [mailto:Mark.Morschhaeuser@dsa.de] Gesendet: Mittwoch, 20. Februar 2019 13:50 An: opensuse-buildservice@opensuse.org Betreff: [!!Mass Mail][opensuse-buildservice] git login credentials for obs source services Hi, I have a git host that requires logins and I want to use the obs_scm service without providing a url like user:login@host/... for every package. So I created a .gitconfig & .git-credentials file for the obsservicerun user in the obsservicerun home directory (/usr/lib/obs according to passwd) with read permissions but it seems that this file is not used by the service. If I execute the checkout command from src_service.log manually it works though. How should this be done? Do I use the wrong user account? I get this error service tar_scm failed: ERROR(128): "Cloning into '/srv/obs/service/11565/out/tmpLgoRio/testpackage'... fatal: could not read Username for 'http://giturl/foo': No such device or address <- if I use user@host, I get "could not read Password" instead " Traceback (most recent call last): File "/usr/lib/obs/service//tar_scm", line 30, in main() File "/usr/lib/obs/service//tar_scm", line 26, in main TarSCM.run() File "/usr/lib/obs/service/TarSCM/__init__.py", line 35, in run task_list.process_list() File "/usr/lib/obs/service/TarSCM/tasks.py", line 116, in process_list self.process_single_task(task) File "/usr/lib/obs/service/TarSCM/tasks.py", line 184, in process_single_task scm_object.fetch_upstream() File "/usr/lib/obs/service/TarSCM/scm/base.py", line 90, in fetch_upstream self.fetch_upstream_scm() File "/usr/lib/obs/service/TarSCM/scm/git.py", line 91, in fetch_upstream_scm <- that basically executes git clone <what> <where> os.removedirs(os.path.join(wdir, self.clone_dir)) File "/usr/lib64/python2.7/os.py", line 170, in removedirs rmdir(name) OSError: [Errno 2] No such file or directory: '/srv/obs/service/11565/out/tmpLgoRio/testpackage' Regards, Mark -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (1)
-
Morschhäuser, Mark