[update] ci
This commit is contained in:
parent
b50164e341
commit
ccb07016c4
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
Jenkinsfile
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/plugins/
|
||||
|
63
Jenkinsfile
vendored
Normal file
63
Jenkinsfile
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
node {
|
||||
try{
|
||||
stage('检出代码'){
|
||||
git branch: "${BRANCH}",credentialsId: 'taolin', url: "${REPO_URL}"
|
||||
sh 'ls'
|
||||
sh 'pwd'
|
||||
echo "Gradle $GRADLE_HOME"
|
||||
echo "Java $JAVA_HOME"
|
||||
}
|
||||
stage("替换图标") {
|
||||
sh 'wget -o logo.png ${APPLOGO}'
|
||||
}
|
||||
stage('修改配置文件'){
|
||||
//获取content所在行 CONTENT_URL
|
||||
def num = getShEchoResult ("sed -n '/content/=' config.xml")
|
||||
sh "sed -i '${num}d' config.xml"
|
||||
sh "sed -i '${num}i<content src=\"${CONTENT_URL}\" />' config.xml"
|
||||
//APP_NAME
|
||||
sh "sed -i 's/<name>.*<\\/name>/<name>${APP_NAME}<\\/name>/g' config.xml"
|
||||
//APP_ID APP_VERSION
|
||||
def verNum = getShEchoResult ("sed -n '/<widget/=' config.xml")
|
||||
sh "sed -i '${verNum}d' config.xml"
|
||||
sh "sed -i '${verNum}i<widget id=\"${APP_ID}\" version=\"${APP_VERSION}\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">' config.xml"
|
||||
sh "cat config.xml"
|
||||
}
|
||||
stage('编译'){
|
||||
try{
|
||||
sh 'npm install'
|
||||
sh 'npm run initial'
|
||||
sh 'npm run logo'
|
||||
sh "npx cordova build android"
|
||||
}catch(e){
|
||||
}
|
||||
}
|
||||
stage('存档'){
|
||||
echo "参数 ${EMAIL}"
|
||||
def apk = getShEchoResult ("find ./platforms/android/app/build/outputs/apk/debug -name '*.apk'")
|
||||
echo "APK ${apk}"
|
||||
def artifactsDir="artifacts"//存放产物的文件夹
|
||||
sh "mkdir ${artifactsDir}"
|
||||
sh "mv ${apk} ${artifactsDir}"
|
||||
sh 'ls artifacts'
|
||||
archiveArtifacts "${artifactsDir}/*"
|
||||
}
|
||||
stage('通知负责人'){
|
||||
emailext(body: "构建项目:${BUILD_URL}\r\n构建完成",mimeType: "text/html",subject: '构建结果通知【成功】',to: "${EMAIL}",attachmentsPattern: "artifacts/app-debug.apk")
|
||||
}
|
||||
} catch (e) {
|
||||
emailext( body: "构建项目:${BUILD_URL}\r\n构建失败,\r\n错误消息:${e.toString()}", subject: '构建结果通知【失败】', to: "${EMAIL}")
|
||||
} finally{
|
||||
// 清空工作空间
|
||||
cleanWs notFailBuild: true
|
||||
}
|
||||
}
|
||||
|
||||
// 获取 shell 命令输出内容
|
||||
def getShEchoResult(cmd) {
|
||||
def getShEchoResultCmd = "ECHO_RESULT=`${cmd}`\necho \${ECHO_RESULT}"
|
||||
return sh (
|
||||
script: getShEchoResultCmd,
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 4.9 KiB |
@ -2,32 +2,41 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<base href= />
|
||||
<title>晶瑞mes-pad</title>
|
||||
<meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover">
|
||||
<meta name=description content="A Quasar Project">
|
||||
<meta name=format-detection content="telephone=no">
|
||||
<meta name=msapplication-tap-highlight content=no>
|
||||
<meta name=viewport
|
||||
content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width,viewport-fit=cover">
|
||||
<meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">
|
||||
<link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png>
|
||||
<link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png>
|
||||
<link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png>
|
||||
<link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png>
|
||||
<link rel=icon type=image/ico href=favicon.ico>
|
||||
<script src=cordova.js></script>
|
||||
<script src=http://injection/www/cordova.js charset=UTF-8></script>
|
||||
<script src=cordova_plugins.js></script>
|
||||
<link href=css/vendor.0d9534bc.css rel=stylesheet>
|
||||
<link href=css/app.1735068f.css rel=stylesheet>
|
||||
<script src="http://10.1.23.61:10001/plugins/cordova-plugin-cszbar/www/zbar.js"></script>
|
||||
<link href=/css/vendor.fb9dfb63.css rel=stylesheet>
|
||||
<link href=/css/app.cda2cbb0.css rel=stylesheet>
|
||||
<link rel=manifest href=manifest.json>
|
||||
<meta name=theme-color content=#027be3>
|
||||
<meta name=apple-mobile-web-app-capable content=yes>
|
||||
<meta name=apple-mobile-web-app-status-bar-style content=default>
|
||||
<meta name=apple-mobile-web-app-title content="Quasar App">
|
||||
<link rel=apple-touch-icon href=icons/apple-icon-120x120.png>
|
||||
<link rel=apple-touch-icon sizes=152x152 href=icons/apple-icon-152x152.png>
|
||||
<link rel=apple-touch-icon sizes=167x167 href=icons/apple-icon-167x167.png>
|
||||
<link rel=apple-touch-icon sizes=180x180 href=icons/apple-icon-180x180.png>
|
||||
<link rel=mask-icon href=icons/safari-pinned-tab.svg color=#027be3>
|
||||
<meta name=msapplication-TileImage content=icons/ms-icon-144x144.png>
|
||||
<meta name=msapplication-TileColor content=#000000>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id=q-app></div>
|
||||
<script src=cordova.js></script>
|
||||
<script src=js/vendor.js></script>
|
||||
<script src=js/app.js></script>
|
||||
<script src=/js/vendor.ba61a4da.js></script>
|
||||
<script src=/js/app.95a9d3a9.js></script>
|
||||
</body>
|
||||
<script src=cordova.js></script>
|
||||
<script src=cordova_plugins.js charset=UTF-8></script>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user