1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| cd MCShow export LANG=en_US.UTF-8 source ~/.bash_profile appName="" appVersion="" appBuild="" appBundleId="" platform="iOS"
getAppInfo(){ basePath=`pwd` ipaFilePath="$basePath/app/MCShow.ipa" if [ ! -f "$ipaFilePath" ]; then echo "未找到ipa包 $ipaFilePath" exit 2002 fi
temIpaDirName="TempPayload" temIpaDirPath="${basePath}/${temIpaDirName}"
if [ -d "$temIpaDirPath" ]; then rm -rf "${temIpaDirPath}" fi
if [[ -f "$ipaFilePath" ]]; then unzip "$ipaFilePath" -d "$temIpaDirPath" fi
appDir="$temIpaDirPath/Payload/`ls "$temIpaDirPath/"Payload`" lcmInfoPlist="${appDir}/Info.plist"
appName=`/usr/libexec/PlistBuddy -c "Print :CFBundleDisplayName" $lcmInfoPlist` appVersion=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" $lcmInfoPlist` appBuild=`/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" $lcmInfoPlist` appBundleId=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" $lcmInfoPlist` if [ -d "$temIpaDirPath" ]; then rm -rf "${temIpaDirPath}" fi }
getAppInfo
offical="Fir.im-Official" standby="Fir.im-Standby" testflight="TestFlight"
if [ "$ShowPlatform" == "$testflight" ];then exit 2001 fi
accessToken="c50924ce66e3f842e454089c2f6e75222892d56e9e7f143ef8c235539a66f984" iconUrl="https://tva1.sinaimg.cn/large/008eGmZEly1gomwuhsuu7j305k05k748.jpg" downloadUrl="http://fir.renchengqi.com/showios"
if [ "$ShowPlatform" == "$offical" ];then downloadUrl="http://fir.hulai.com/shai" accessToken="c50924ce66e3f842e454089c2f6e75222892d56e9e7f143ef8c235539a66f984" fi
url="https://oapi.dingtalk.com/robot/send?access_token=$accessToken" header="Content-Type: application/json"
title="$appName($platform)更新" text="[$appName($platform)更新]($downloadUrl)\n\n \ ![$appName]($iconUrl)\n\n \ 链接:[$downloadUrl]($downloadUrl)\n\n \ 版本: $appVersion (Build: $appBuild)\n\n \ 更新内容: $ReleaseNotes\n\n \ Git记录: [https://jenkins.hulai.com/view/shai/job/shai-ios/${BUILD_NUMBER}/changes](https://jenkins.hulai.com/view/shai/job/shai-ios/${BUILD_NUMBER}/changes)\n"
rawData="{ \"msgtype\":\"actionCard\", \ \"actionCard\": { \ \"title\": \"$title\", \ \"text\": \"$text\", \ \"hideAvatar\": \"0\", \ \"btnOrientation\": \"0\", \ \"singleTitle\": \"\" \ } \ }"
curl --request POST "$url" -H "$header" --data-raw "$rawData"
|