Skip to content

Commit

Permalink
fix: deployment arch of uploading jar and war packages is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail committed Aug 8, 2023
1 parent dc96b87 commit c9cbe0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions check_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ echo "start check code style by yapf"
yapf --exclude env --exclude venv --exclude static --exclude www/migrations --exclude console/migrations --exclude www/alipay_direct --exclude www/utils/mnssdk --exclude backends --style style.cfg -r ./ -i
[[ -z $(git status -s) ]] || {
echo "some code do not format before commit, please run 'make format' before git commit"
echo "$(git status -s)"
exit 1
}
echo "check code style success"
4 changes: 3 additions & 1 deletion console/services/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def __init_package_build_app(self, region):
tenant_service.create_status = "creating"
return tenant_service

def create_package_upload_info(self, region, tenant, user, service_cname, k8s_component_name, event_id, pkg_create_time):
def create_package_upload_info(self, region, tenant, user, service_cname, k8s_component_name, event_id, pkg_create_time,
arch):
service_cname = service_cname.rstrip().lstrip()
is_pass, msg = self.check_service_cname(tenant, service_cname, region)
if not is_pass:
Expand All @@ -253,6 +254,7 @@ def create_package_upload_info(self, region, tenant, user, service_cname, k8s_co
new_service.k8s_component_name = k8s_component_name if k8s_component_name else service_alias
new_service.git_url = "/grdata/package_build/components/" + service_id + "/events/" + event_id
new_service.code_version = pkg_create_time
new_service.arch = arch
new_service.save()
ts = TenantServiceInfo.objects.get(service_id=new_service.service_id, tenant_id=new_service.tenant_id)
return ts
Expand Down
3 changes: 2 additions & 1 deletion console/views/app_create/source_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,15 @@ def post(self, request, tenantName, *args, **kwargs):
event_id = request.data.get("event_id")
service_cname = request.data.get("service_cname", None)
k8s_component_name = request.data.get("k8s_component_name", "")
arch = request.data.get("arch", "amd64")
if k8s_component_name and app_service.is_k8s_component_name_duplicate(group_id, k8s_component_name):
raise ErrK8sComponentNameExists
try:
pkg_record = package_upload_service.get_upload_record(self.team_name, region, event_id)
pkg_create_time = pkg_record.create_time
# 创建信息
ts = app_service.create_package_upload_info(region, self.tenant, self.user, service_cname, k8s_component_name,
event_id, pkg_create_time)
event_id, pkg_create_time, arch)
# 更新状态
update_record = {
"status": "finished",
Expand Down

0 comments on commit c9cbe0a

Please sign in to comment.