Commit b22f7eb0 authored by guozhipeng's avatar guozhipeng

fix

parent e2584d4d
...@@ -8,14 +8,14 @@ sap.ui.define([ ...@@ -8,14 +8,14 @@ sap.ui.define([
], function (UIComponent, ResourceModel, JSONModel, models, jQuery) { ], function (UIComponent, ResourceModel, JSONModel, models, jQuery) {
"use strict"; "use strict";
return UIComponent.extend("webapp.Component", { return UIComponent.extend("ns.main.Component", {
metadata: { metadata: {
interfaces: ["sap.ui.core.IAsyncContentCreation"], interfaces: ["sap.ui.core.IAsyncContentCreation"],
manifest: "json", manifest: "json",
"config": { "config": {
// "serviceUrl": "service/data.json", // "serviceUrl": "service/data.json",
"i18nBundle": "webapp.i18n.i18n" "i18nBundle": "ns.main.i18n.i18n"
} }
}, },
...@@ -49,4 +49,4 @@ sap.ui.define([ ...@@ -49,4 +49,4 @@ sap.ui.define([
} }
}); });
}); });
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
data-sap-ui-async="true" data-sap-ui-async="true"
data-sap-ui-preload="async" data-sap-ui-preload="async"
data-sap-ui-resourceroots='{ data-sap-ui-resourceroots='{
"webapp": "./", "ns.main": "./",
"sap.ui.demo.mock": "mockdata", "sap.ui.demo.mock": "mockdata",
"sap.ui.js":"js" "sap.ui.js":"js"
}' }'
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"sap.ui5": { "sap.ui5": {
"_version": "1.1.0", "_version": "1.1.0",
"rootView": { "rootView": {
"viewName": "webapp.view.App", "viewName": "ns.main.view.App",
"type": "XML", "type": "XML",
"async": true "async": true
}, },
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
"i18n": { "i18n": {
"type": "sap.ui.model.resource.ResourceModel", "type": "sap.ui.model.resource.ResourceModel",
"settings": { "settings": {
"bundleName": "webapp.i18n.i18n" "bundleName": "ns.main.i18n.i18n"
} }
}, },
"YesOrNull_DWL":{ "YesOrNull_DWL":{
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
"config": { "config": {
"routerClass": "sap.m.routing.Router", "routerClass": "sap.m.routing.Router",
"viewType": "XML", "viewType": "XML",
"viewPath": "webapp.view", "viewPath": "ns.main.view",
"controlId": "app", "controlId": "app",
"controlAggregation": "pages", "controlAggregation": "pages",
"async": true, "async": true,
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
"authenticationType": "xsuaa", "authenticationType": "xsuaa",
"csrfProtection": true "csrfProtection": true
}, },
{
"source": "^/(.*)$",
"target": "/main/webapp/$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
},
{ {
"source": "^(.*)$", "source": "^(.*)$",
"target": "$1", "target": "$1",
......
#!/bin/bash
#作者:郭智朋 2025-02-12
#选择工具栏 编辑 —> 文档格式转换 —> 转换为UNIX格式,保存。(中文的notepad++)编码 UTF-8
#快速指令集 bash webJavaBtp.sh
#编译不同版本的jar包 供服务器环境部署
#使用说明,用来提示输入参数
usage() {
echo "Usage: bash webJavaBtp.sh [dev|tes|pre|pro]"
echo "dev 开发环境"
echo "tes 测试环境"
echo "pre 预生产环境"
echo "pro 生产环境"
exit 1
}
#拉取代码
gitpull(){
#校验分支
validateBranch
#查看代码最新状态
echo "-- 查看代码最新状态 --"
echo -e "\033[30;42m git status \033[0m"
gitstatus=$(git status)
echo "${gitstatus}"
gitstatusStr="clean"
if [[ $gitstatus =~ $gitstatusStr ]];then
#查看代码最新状态成功
echo -e "\033[30;42m 查看代码最新状态成功 \033[0m"
else
#存在待提交的代码
echo -e "\033[30;41m 【存在待提交的代码 ctrl + c 退出】 \033[0m"
#read -p "ctrl + c 退出"
fi
#拉取最新代码
echo "-- 拉取最新代码 --"
echo -e "\033[30;42m git pull \033[0m"
gitpull=$(git pull)
echo "${gitpull}"
gitpullStr="Already"
gitpullStr0="changed"
if [[ $gitpull =~ $gitpullStr ]] || [[ $gitpull =~ $gitpullStr0 ]];then
#拉取最新代码成功
echo -e "\033[30;42m 拉取最新代码成功 \033[0m"
else
#存在待提交的代码
echo -e "\033[30;41m 【拉取最新代码失败 ctrl + c 退出】 \033[0m"
#read -p "ctrl + c 退出"
fi
}
#图标
logo(){
echo " _ _ _ _ ____ _ "
echo " | | (_) | | | _ \| | "
echo " | |__ _ _ _| | __| | |_) | |_ _ __ "
echo " | '_ \| | | | | |/ _\ | _ <| __| '_ \ "
echo " | |_) | |_| | | | (_| | |_) | |_| |_) |"
echo " |_.__/ \__,_|_|_|\__,_|____/ \__| .__/ "
echo " | | "
echo " |_| "
echo "Usage: bash webJavaBtp.sh [dev|tes|pre|pro]"
#echo " 执行部署命令:(参考网址:https://cap.cloud.sap/docs/guides/deployment/to-cf?impl-variant=java#deploy-using-cf-push) "
#echo " 打包压缩包命令: mvn clean compile package -Dmaven.test.skip=true "
#echo " 登录BTP命令: cf login "
#echo " 输入邮箱Email: liaozg@unibetter-ic.com "
#echo " 输入密码Password: 略 "
#echo " 选择公司 Shenzhen Lianchuangjie Technology Co., Ltd._trial-cjmy9gtn 输入2 "
#echo " 选择环境 dev 输入1 "
#echo " 登录成功 "
#echo " 初次使用 cf install-plugin Create-Service-Push 输入y "
#echo " 每次部署使用 cf push lianchuangjie-tes "
}
#文件字符串替换
replaceStr() {
local fileUrl=$1
local old=$2
local new=$3
echo "文件: $fileUrl"
#echo "旧值: $old"
#echo "新值: $new"
if cat "${fileUrl}" | grep "${old}" > /dev/null
then
sed -i "s/${old}/${new}/" ${fileUrl}
echo "$old 替换为:$new 成功"
else
if cat "${fileUrl}" | grep "${new}" > /dev/null
then
echo "$old 替换为:$new 成功"
else
echo "$old 替换为:$new 失败"
fi
fi
}
#秒数转时间
secondsToTime() {
local $starttime=$1
local $endtime=$2
start_seconds=$(date --date="$starttime" +%s);
end_seconds=$(date --date="$endtime" +%s);
#使用的毫秒数
seconds=$((end_seconds-start_seconds))
# 计算小时数
hours=$((seconds / 3600))
# 计算剩余秒数,用于计算分钟
remainder=$((seconds % 3600))
# 计算分钟数
minutes=$((remainder / 60))
# 计算剩余秒数
seconds=$((remainder % 60))
echo "开始时间(北京时间): $starttime 结束时间(北京时间): $endtime 用时: $hours小时 $minutes分钟 $seconds秒"
#echo -e "\033[30;42m 开始时间(北京时间): $starttime 结束时间(北京时间): $endtime 用时: $hours小时 $minutes分钟 $seconds秒 \033[0m"
}
#进度条
progressBar(){
i=0
str='#'
ch=('|' '\' '-' '/')
index=0
while [ $i -le 25 ]
do
printf "[%-25s][%d%%][%c]\r" $str $(($i*4)) ${ch[$index]}
str+='#'
let i++
let index=i%4
sleep 0.5
done
printf "\n"
}
#公共接口
common(){
starttime=`TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S`
echo "开始时间(北京时间): $starttime"
logo #logo加载
echo -e "\033[30;42m 当前环境${buildEvn} \033[0m"
#校验登录状态
account=$(cf services)
accountMatch='.*succeeded.*'
if ! [[ $account =~ $accountMatch ]]; then
echo "请重新登录!"
#登录BTP 输入密码: Gzp@123456 后回车。
echo -e "\033[30;42m 登录BTP test 子账户 输入密码: Gzp@123456 后回车 \033[0m"
# 登录BTP命令:
cf login -a https://api.cf.cn40.platform.sapcloud.cn -o "Shenzhen-Lianchuangjie-Technology-Co-Ltd-test-cnrc164l" -s gzpTest -u zhipeng.guo@boscloud.cn
#exit 1
fi
echo "已登录成功!"
# 使用mbt build组装
echo -e "\033[30;42m 使用mbt build组装 \033[0m"
starttime1=`TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S`
echo "开始时间(北京时间): $starttime1"
mbt build -t gen --mtar mta.mtar
#https://unicode.57cha.com/ unicode编码转换在线转换
#【系统消息】正在发布,稍后请重新登录!
## curl -X POST \
## -H "Content-Type: application/json" \
## -d '{"type":"SYSTEM","message":"\u3010\u7cfb\u7edf\u6d88\u606f\u3011\u6b63\u5728\u53d1\u5e03\uff0c\u7a0d\u540e\u8bf7\u91cd\u65b0\u767b\u5f55\uff01"}' \
## ${url}/webSocket/sendSystemMessage?appKey=0d693250-4a96-4c3e-b6ef-fd036207baa8
# Deploy to Cloud 部署到云
echo -e "\033[30;42m Deploy to Cloud 部署到云 \033[0m"
starttime2=`TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S`
echo "开始时间(北京时间): $starttime2"
cf deploy gen/mta.mtar
#添加进度条
#progressBar
#【系统消息】发布完成,请重新登录!
## curl -X POST \
## -H "Content-Type: application/json" \
## -d '{"type":"SYSTEM","message":"\u3010\u7cfb\u7edf\u6d88\u606f\u3011\u53d1\u5e03\u5b8c\u6210\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\uff01"}' \
## ${url}/webSocket/sendSystemMessage?appKey=0d693250-4a96-4c3e-b6ef-fd036207baa8
## echo -e "\033[30;42m ${buildEvn}发布完成的通知已发送 \033[0m"
#结束时间(北京时间)
echo -e "\033[30;42m 部署完成 \033[0m"
endtime=`TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S`
secondsToTime ${starttime} ${starttime1}
secondsToTime ${starttime1} ${starttime2}
secondsToTime ${starttime2} ${endtime}
secondsToTime ${starttime} ${endtime}
}
#编译开发环境
dev(){
buildEvn="dev"
nameStr="【开发】"
applicationsName='lianchuangjie-dev'
url='https://lianchuangjie-dev.unibetter-ic.com'
#执行编译操作
common
}
#编译测试环境
tes(){
buildEvn="tes"
nameStr="【测试】"
applicationsName='lianchuangjie-tes'
url='https://lianchuangjie-tes.unibetter-ic.com'
#执行编译操作
common
}
#编译预生产环境
pre(){
buildEvn="pre"
nameStr="【预生产】"
applicationsName='lianchuangjie-pre'
url='https://lianchuangjie-pre.unibetter-ic.com'
#执行编译操作
common
}
#编译生产环境
pro(){
buildEvn="pro"
nameStr=""
applicationsName='sap'
url='https://sap.unibetter-ic.com'
#执行编译操作
common
}
#校验分支
validateBranch(){
gitstatus=$(git status)
gitstatusMasterMatch='On branch master'
gitstatusProductionMatch='On branch production'
masterBranchMatch='dev|tes|pre'
productionBranchMatch='pro'
if [[ $buildEvn =~ $masterBranchMatch ]] && ! [[ $gitstatus =~ $gitstatusMasterMatch ]]; then
echo "分支错误,请使用“master”分支!"
exit 1
fi
if [[ $buildEvn =~ $productionBranchMatch ]] && ! [[ $gitstatus =~ $gitstatusProductionMatch ]]; then
echo "分支错误,请使用“production”分支!"
exit 1
fi
}
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
"dev")
dev
;;
"tes")
tes
;;
"pre")
pre
;;
"pro")
pro
;;
*)
usage
;;
esac
{ {
"xsappname": "lianchuangjie", "xsappname": "lianchuangjie-test",
"tenant-mode": "dedicated", "tenant-mode": "dedicated",
"scopes": [ "scopes": [
{ {
......
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