zoukankan      html  css  js  c++  java
  • 构建源码

     1 echo $HOME
     2 # For macOS 10.12+, new security enforcement need following command.
     3 #security set-key-partition-list -S apple: -k "Password" -D $HOME/Library/Keychains/login.keychain-db
     4 #security set-key-partition-list -S apple-tool:,apple: -s -k "Password" $HOME/Library/Keychains/login.keychain-db
     5 #security unlock-keychain -p "Password" $HOME/Library/Keychains/login.keychain-db
     6 security unlock-keychain -p "yunwei" $HOME/Library/Keychains/login.keychain
     7 rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
     8 rm -rf ~/Library/Developer/Xcode/DerivedData
     9 rm -rf ~/Library/Caches/com.apple.dt.Xcode
    10 /usr/local/bin/pod repo update --verbose lifesense-commonlib_ios-cocoapodsspecs
    11 /usr/local/bin/pod install --verbose --no-repo-update
    12 
    13 if [ "${to_deploy}" == "dev" ];then
    14 deploy="Debug"
    15 pyname="dev"
    16 elif [ "${to_deploy}" == "qa" ];then
    17 deploy="Distribution"
    18 pyname="qa"
    19 elif [ "${to_deploy}" == "alpha" ];then
    20 deploy="Distribution"
    21 pyname="qa"
    22 elif [ "${to_deploy}" == "enterprise" ];then
    23 deploy="Enterprise"
    24 pyname="enterprise"
    25 elif [ "${to_deploy}" == "prerelease" ];then
    26 deploy="PreRelease"
    27 pyname="prerelease"
    28 elif [ "${to_deploy}" == "qaEnterprise" ];then
    29 deploy="QaEnterprise"
    30 pyname="qaEnterprise"
    31 elif [ "${to_deploy}" == "beta" ];then
    32 deploy="Release"
    33 pyname="release"
    34 else 
    35 deploy="Release"
    36 pyname="release"
    37 fi
    38 
    39 python ${WORKSPACE}/Build_scripts/build_$pyname.py
    40 
    41 ios_app_version=$(cat BuildProducts/LSWearable_$deploy.xcarchive/Info.plist |grep -A4 CFBundleShortVersionString|awk -F> '/string/ {print $2}'|awk -F< '{print $1}'|xargs |sed 's/ /_/')
    42 mv BuildProducts/LSWearable.ipa BuildProducts/lxyd_${ios_app_version}_${BUILD_NUMBER}.ipa
    43 mv Build_scripts/app.plist BuildProducts/
    44 sed -i "" "s@NILURL@https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}.ipa@" BuildProducts/app.plist
    45 mv BuildProducts/app.plist BuildProducts/lxyd_${ios_app_version}_${BUILD_NUMBER}.plist
    46 mv BuildProducts/LSWearable_$deploy.xcarchive/dSYMs/LSWearable.app.dSYM/Contents/Resources/DWARF/LSWearable BuildProducts/
    47 mv BuildProducts/LSWearable_$deploy.xcarchive/Info.plist BuildProducts/
    48 rm -rf BuildProducts/LSWearable_$deploy.xcarchive
    49 rm -f BuildProducts/QRCode.png
    50 mv Build_scripts/HTML/* BuildProducts/
    51 sed -i "" "s@lxyd_2.0.5.15_38.html@ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/install.html@" BuildProducts/qrcode.html
    52 
    53 cat > BuildProducts/install.html << EOF
    54 <!Doctype html>
    55 <html xmlns=http://www.w3.org/1999/xhtml>
    56 <?xml version="1.0" encoding="UTF-16"?>
    57 <html>
    58 <head><title>install-lxyd-ios</title></head>
    59 <body>
    60  <ul>
    61   <li>
    62    <a href="itms-services://?action=download-manifest&url=https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}.plist">点击下载</a>
    63   </li>
    64  </ul>
    65 </body>
    66 </html>
    67 EOF
    68 
    69 sed -i "" "s@APPURL@https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}.plist@" BuildProducts/qrcode.html
    70 sed -i "" "s@QRURL@http://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/install.html@" BuildProducts/qrcode.html
    71 
    72 rm -rf ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}
    73 mkdir -p ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}
    74 cp BuildProducts/* ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/
    75 
    76 
    77 while [ 0 -eq 0 ]
    78 do
    79     echo ".................. job begin  ..................."     
    80     rsync -Ravz --progress --port=11873 --password-file=/Users/yunwei/node/workspace/rsyncd.pass ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/* rsy_user@123.59.80.13::static-app-test/
    81     if [ $? -eq 0 ]; then
    82         echo "--------------- job complete ---------------"
    83         break;
    84     else
    85         echo "...............error occur, retry in 2 seconds .........."
    86         sleep 2
    87     fi
    88 done
    89 
    90 buildUrl=${BUILD_URL}
    91 url=http://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/qrcode.html 
    92 python sendemail.py $url jenkins@lifesense.com Sz@201807 ${buildUrl} ${to_deploy}





     1 if [ ${to_deploy} != "all" ]
     2 then
     3 rm -f weidong/build/outputs/apk/*-release-unaligned.apk
     4 rm -f weidong/build/outputs/mapping/guanwang/release/dump.txt
     5 build_verison=$(ls weidong/build/outputs/apk/lxyd-*|awk -F/ '{print $NF}'|sed 's/.apk//')-${BUILD_NUMBER}
     6 apkname=$(ls weidong/build/outputs/apk/lxyd-*|awk -F/ '{print $NF}'|sed 's/.apk//').apk
     7 buildUrl=${BUILD_URL}
     8 apkurl=http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/$apkname
     9 mkdir -p android/$JOB_BASE_NAME/${to_deploy}/$build_verison/mapping
    10 mv weidong/build/outputs/apk/*.apk android/$JOB_BASE_NAME/${to_deploy}/$build_verison/
    11 mv weidong/build/outputs/mapping/${to_deploy}/release/* android/$JOB_BASE_NAME/${to_deploy}/$build_verison/mapping/
    12 #生成qrcode.html
    13 mv weidong/HTML/* android/$JOB_BASE_NAME/${to_deploy}/$build_verison/
    14 htmlpath=android/$JOB_BASE_NAME/${to_deploy}/$build_verison/qrcode.html
    15 sed -i "s@APPURL@http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/$apkname@" $htmlpath
    16 sed -i "s@QRURL@http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/qrcode.html@" $htmlpath
    17 buildDate=`date "+%Y-%m-%d %H:%M:%S"`
    18 sed -i "s@BUILDTIME@$buildDate@" $htmlpath
    19 sed -i "s@APKINFO@$apkname@" $htmlpath
    20 
    21 
    22 
    23 rsync -Ravz --port=11873 --password-file=/data/android/rsyncd.pass android/$JOB_BASE_NAME/${to_deploy}/$build_verison/* rsy_user@123.59.80.13::static-app-test/
    24 fi
    25 
    26 
    27 python sendemail.py http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/qrcode.html jenkins@lifesense.com Sz@201807 ${buildUrl} ${to_deploy} ${to_stage} 
    
    
    
     
    ---by littleyang 测试就是测试一下
  • 相关阅读:
    汇编之EBP的认识。
    【转】PE详解
    迟到的,2016年终总结
    Java 反射
    Java 集合与容器类
    Java 类加载与实例化
    Java 类与对象
    Java 值传递与对象拷贝
    Java 面向对象
    二叉树
  • 原文地址:https://www.cnblogs.com/littleyang/p/9790038.html
Copyright © 2011-2022 走看看