Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Amazon-Selection-Data
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abel_cjy
Amazon-Selection-Data
Commits
fcb6d659
Commit
fcb6d659
authored
Mar 03, 2025
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git代码同步至服务器
parent
1f720936
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
auto_desploy.py
Pyspark_job/script/auto_desploy.py
+6
-6
No files found.
Pyspark_job/script/auto_desploy.py
View file @
fcb6d659
...
...
@@ -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
==
'develop
er
'
:
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
(
"develop
er
"
)
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
==
'develop
er
'
:
# 备份原始目录
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
,
"develop
er
"
)
update_flag
=
git_update
(
branch_name
)
# 更新分区
if
update_flag
and
branch_name
==
'develop'
:
if
update_flag
and
branch_name
==
'develop
er
'
:
zip_yswgutils_to_hdfs
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment