Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
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
钟尚武
sun
Commits
4647b9b0
Commit
4647b9b0
authored
Feb 28, 2019
by
张永
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/channel_package_zy' into 'dev'
添加日志 See merge request
alpha/sun!79
parents
5abe0a4a
fe8c3122
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
channel_package_tools.py
utils/channel_package_tools.py
+11
-4
No files found.
utils/channel_package_tools.py
View file @
4647b9b0
...
@@ -6,7 +6,7 @@ from django.conf import settings
...
@@ -6,7 +6,7 @@ from django.conf import settings
from
gm_upload.utils.qiniu_tool
import
QiniuTool
from
gm_upload.utils.qiniu_tool
import
QiniuTool
from
qiniu
import
put_file
from
qiniu
import
put_file
from
utils.logger
import
log_error
from
utils.logger
import
log_error
,
info_logger
class
QiniuFileTool
(
QiniuTool
):
class
QiniuFileTool
(
QiniuTool
):
...
@@ -73,7 +73,7 @@ class ChannelPackage(object):
...
@@ -73,7 +73,7 @@ class ChannelPackage(object):
os
.
remove
(
self
.
apk
)
os
.
remove
(
self
.
apk
)
os
.
remove
(
self
.
channel_prefix
+
'_'
+
channel_name
+
'.apk'
)
os
.
remove
(
self
.
channel_prefix
+
'_'
+
channel_name
+
'.apk'
)
def
upload_apk
(
self
,
channel_name
):
def
upload_apk
(
self
,
channel_name
):
# zhuoyi
chn_apk_path
=
self
.
build_channel_apk
(
channel_name
)
chn_apk_path
=
self
.
build_channel_apk
(
channel_name
)
apk_uri
=
self
.
apk_key
(
channel_name
,
self
.
version
)
apk_uri
=
self
.
apk_key
(
channel_name
,
self
.
version
)
QiniuTool
.
delete
(
apk_uri
,
settings
.
APK_SCOPE
)
QiniuTool
.
delete
(
apk_uri
,
settings
.
APK_SCOPE
)
...
@@ -103,10 +103,17 @@ class ChannelPackage(object):
...
@@ -103,10 +103,17 @@ class ChannelPackage(object):
apk_scope
=
settings
.
APK_SCOPE
apk_scope
=
settings
.
APK_SCOPE
version_key
=
cls
.
apk_key
(
channel
,
version
)
version_key
=
cls
.
apk_key
(
channel
,
version
)
current_key
=
cls
.
apk_key
(
channel
,
settings
.
APK_RELEASE_DIR
)
current_key
=
cls
.
apk_key
(
channel
,
settings
.
APK_RELEASE_DIR
)
print
(
'current_key:'
,
current_key
)
ret
,
info
=
QiniuTool
.
bucket
.
stat
(
apk_scope
,
current_key
)
ret
,
info
=
QiniuTool
.
bucket
.
stat
(
apk_scope
,
current_key
)
info_logger
.
debug
(
{
'channel'
:
channel
,
'version'
:
version
,
'version_key'
:
version_key
,
'current_key'
:
current_key
,
'ret'
:
ret
}
)
if
ret
:
if
ret
:
print
(
'delete'
)
QiniuTool
.
delete
(
current_key
,
apk_scope
)
QiniuTool
.
delete
(
current_key
,
apk_scope
)
QiniuTool
.
copy
(
version_key
,
current_key
,
apk_scope
,
apk_scope
)
QiniuTool
.
copy
(
version_key
,
current_key
,
apk_scope
,
apk_scope
)
if
need_refresh
:
if
need_refresh
:
...
...
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