Commit fcb6d659 by chenyuanjie

git代码同步至服务器

parent 1f720936
......@@ -11,7 +11,7 @@ dev_work_place = "/opt/module/spark/demo/py_demo"
def get_git_work_place(branch_name: str) -> str:
if branch_name == 'develop':
if branch_name == 'developer':
return "/root/git_work_place"
usrName = CommonUtil.safeIndex(branch_name.split("/"), 1, None)
assert usrName is not None, "根据分支获取用户名失败!"
......@@ -32,7 +32,7 @@ def crlf_2_lf(full_path):
def zip_yswgutils_to_hdfs():
git_work_place = get_git_work_place("develop")
git_work_place = get_git_work_place("developer")
dist_src = f"{git_work_place}/Pyspark_job"
work_place = "/tmp"
os.chdir(work_place)
......@@ -77,7 +77,7 @@ def git_update(branch_name):
if len(os.listdir(work_place)) <= 0:
cmds = [
'git init',
'git remote add origin http://47.106.101.75/selection/Amazon-Selection.git',
'git remote add origin http://47.106.101.75/abel_cjy/Amazon-Selection-Data.git',
'git config core.sparseCheckout true',
f'echo "{src}" >> .git/info/sparse-checkout',
'git pull --depth=1 origin master',
......@@ -98,7 +98,7 @@ def git_update(branch_name):
if output.startswith("There is no tracking information for the current branch."):
update_flag = False
if update_flag and branch_name == 'develop':
if update_flag and branch_name == 'developer':
# 备份原始目录
cmd = f"cp -r {dev_work_place} {dev_work_place}_back"
os.popen(cmd)
......@@ -156,8 +156,8 @@ def zip_yswgutils_to_hdfs_local():
if __name__ == '__main__':
branch_name = CommonUtil.get_sys_arg(1, "develop")
branch_name = CommonUtil.get_sys_arg(1, "developer")
update_flag = git_update(branch_name)
# 更新分区
if update_flag and branch_name == 'develop':
if update_flag and branch_name == 'developer':
zip_yswgutils_to_hdfs()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment