获取远程代码仓库的scm info信息(需要用户名密码权限) :param scm_type: :param scm_url: :param source_dir: :param username: :param password: :return:
(self, scm_type, scm_url, source_dir, username=None, password=None)
| 79 | return None |
| 80 | |
| 81 | def get_remote_scm_info(self, scm_type, scm_url, source_dir, username=None, password=None): |
| 82 | """ |
| 83 | 获取远程代码仓库的scm info信息(需要用户名密码权限) |
| 84 | :param scm_type: |
| 85 | :param scm_url: |
| 86 | :param source_dir: |
| 87 | :param username: |
| 88 | :param password: |
| 89 | :return: |
| 90 | """ |
| 91 | os.environ.update({"GIT_SSL_NO_VERIFY": "1"}) |
| 92 | |
| 93 | try: |
| 94 | remote_scm_info = ScmClient( |
| 95 | scm_type=scm_type, |
| 96 | scm_url = scm_url, |
| 97 | source_dir=source_dir, |
| 98 | scm_username=username, |
| 99 | scm_password=password |
| 100 | ).info(remote=True) |
| 101 | return remote_scm_info |
| 102 | except Exception as err: |
| 103 | raise NodeError(code=errcode.E_NODE_TASK_SCM_FAILED, msg="获取远端代码库信息失败! %s" % str(err)) |
| 104 | |
| 105 | def input_token(self): |
| 106 | """ |
no test coverage detected