デプロイ不具合修正

This commit is contained in:
xiaozhe.ma
2024-09-25 11:39:50 +09:00
parent ae67ec8751
commit 886969e941
4 changed files with 49 additions and 40 deletions

File diff suppressed because one or more lines are too long

View File

@@ -216,7 +216,9 @@ def deoployappfromkintone(app:str,revision:str,c:config.KINTONE_ENV):
headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"}
url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json" url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/deploy.json"
data = {"apps":[{"app":app,"revision":revision}],"revert": False} data = {"apps":[{"app":app,"revision":revision}],"revert": False}
print(data)
r = httpx.post(url,headers=headers,data=json.dumps(data)) r = httpx.post(url,headers=headers,data=json.dumps(data))
print(r.json)
return r.json return r.json
# 既定項目に含めるアプリのフィールドのみ取得する # 既定項目に含めるアプリのフィールドのみ取得する
@@ -397,26 +399,33 @@ def updateappjscss(app,uploads,c:config.KINTONE_ENV):
current_mobile_js = customize['mobile'].get('js', []) current_mobile_js = customize['mobile'].get('js', [])
current_mobile_css = customize['mobile'].get('css', []) current_mobile_css = customize['mobile'].get('css', [])
current_js = [item for item in current_js if not (item.get('type') == 'URL' and item.get('url', '').endswith('alc_runtime.js'))] current_js = [item for item in current_js if not (item.get('type') == 'URL' and item.get('url', '').endswith('alc_runtime.js'))]
for upload in uploads: for upload in uploads:
for key in upload: for key in upload:
filename = os.path.basename(key) filename = os.path.basename(key)
if key.endswith('.js'): if key.endswith('.js'):
existing_js = next((item for item in current_js if item['file']['name'] == filename), None) existing_js = next((item for item in current_js if item['file']['name'] == filename), None)
if existing_js: if existing_js:
existing_js['file']['fileKey'] = upload[key] current_js = [item for item in current_js if item['file'].get('name') != filename]
dsjs.append({'type':'FILE','file':{'fileKey':upload[key]}})
else: else:
if (key.endswith('alc_runtime.js') and config.DEPLOY_MODE == "DEV"): if (key.endswith('alc_runtime.js') and config.DEPLOY_MODE == "DEV"):
dsjs.append({'type':'URL','url':config.DEPLOY_JS_URL}) dsjs.append({'type':'URL','url':config.DEPLOY_JS_URL})
else: else:
dsjs.append({'type':'FILE','file':{'fileKey':upload[key]}}) dsjs.append({'type':'FILE','file':{'fileKey':upload[key]}})
elif key.endswith('.css'): elif key.endswith('.css'):
existing_css = next((item for item in current_css if item['file']['name'] == key), None) existing_css = next((item for item in current_css if item['file']['name'] == filename), None)
if existing_css: if existing_css:
existing_css['file']['fileKey'] = upload[key] current_css = [item for item in current_css if item['file'].get('name') != filename]
dscss.append({'type': 'FILE', 'file': {'fileKey': upload[key]}})
else: else:
dscss.append({'type': 'FILE', 'file': {'fileKey': upload[key]}}) dscss.append({'type': 'FILE', 'file': {'fileKey': upload[key]}})
#現在のJSとCSSがdsjsに追加する #現在のJSとCSSがdsjsに追加する
current_js = [{'type': 'FILE', 'file': {'fileKey': item['file']['fileKey']}}
for item in current_js
if item.get('type') == 'FILE' and 'fileKey' in item.get('file', {})]
current_css = [{'type': 'FILE', 'file': {'fileKey': item['file']['fileKey']}}
for item in current_css
if item.get('type') == 'FILE' and 'fileKey' in item.get('file', {})]
dsjs.extend(current_js) dsjs.extend(current_js)
dscss.extend(current_css) dscss.extend(current_css)
mbjs.extend(current_mobile_js) mbjs.extend(current_mobile_js)
@@ -424,17 +433,17 @@ def updateappjscss(app,uploads,c:config.KINTONE_ENV):
ds ={'js':dsjs,'css':dscss} ds ={'js':dsjs,'css':dscss}
mb ={'js':mbjs,'css':mbcss} mb ={'js':mbjs,'css':mbcss}
data = {'app':app,'scope':'ALL','desktop':ds,'mobile':mb} data = {'app':app,'scope':'ALL','desktop':ds,'mobile':mb,'revision':customize["revision"]}
headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"} headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE,"Content-Type": "application/json"}
url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/customize.json" url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/customize.json"
print(data) print(json.dumps(data))
r = httpx.put(url,headers=headers,data=json.dumps(data)) r = httpx.put(url,headers=headers,data=json.dumps(data))
return r.json() return r.json()
#kintone カスタマイズ情報 #kintone カスタマイズ情報
def getappcustomize(app,c:config.KINTONE_ENV): def getappcustomize(app,c:config.KINTONE_ENV):
headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE} headers={config.API_V1_AUTH_KEY:c.API_V1_AUTH_VALUE}
url = f"{c.BASE_URL}{config.API_V1_STR}/app/customize.json" url = f"{c.BASE_URL}{config.API_V1_STR}/preview/app/customize.json"
params = {"app":app} params = {"app":app}
r = httpx.get(url,headers=headers,params=params) r = httpx.get(url,headers=headers,params=params)
return r.json() return r.json()

View File

@@ -218,10 +218,10 @@ export default defineComponent({
// ステッパー関連の関数 // ステッパー関連の関数
const nextBtnCheck = () => { const nextBtnCheck = () => {
const s = step.value const stepNo = step.value
if (s === 1) { if (stepNo === 1) {
return !(data.value.sourceApp?.id && data.value.fieldList?.length > 0 && data.value.fieldList?.every(f => f.source?.name)); return !(data.value.sourceApp?.id && data.value.fieldList?.length > 0 && data.value.fieldList?.every(f => f.source?.name));
} else if (s === 2) { } else if (stepNo === 2) {
return !data.value.fieldList?.every(f => f.dropDown?.name); return !data.value.fieldList?.every(f => f.dropDown?.name);
} }
return true; return true;

View File

@@ -57,7 +57,7 @@ export default {
// rowsNumber: xx if getting data from a server // rowsNumber: xx if getting data from a server
}); });
const rows = reactive([]); const rows = reactive([]);
const selected = ref(props.selectedFields && props.selectedFields.length>0?props.selectedFields:[]); const selected = ref((props.selectedFields && props.selectedFields.length>0)?props.selectedFields:[]);
onMounted(async () => { onMounted(async () => {
const url = props.fieldTypes.includes('SPACER')?'api/v1/allfields':'api/v1/appfields'; const url = props.fieldTypes.includes('SPACER')?'api/v1/allfields':'api/v1/appfields';