
image:
https://api.qrserver.com/v1/create-qr-code/?size=120×120&data=xxx
cd /var/lib/jenkins/workspace/$newAppVersion
type=$(echo $Type | tr '[:upper:]' '[:lower:]')
changes=`sh -c 'git show-branch --no-name HEAD'`
revCount=`sh -c 'git rev-list --all --count'`
branch=$(echo `sh -c 'git name-rev --name-only HEAD'` | sed "s/\/remotes\/origin\///")
if [ -n "$SCM_CHANGELOG" ]
then SCM_CHANGELOGS="- "$(echo ${SCM_CHANGELOG}| sed 's/\\n/\\n> -/g' | sed 's/...$//g')
fi
UType=$Type; LType=$type
if [ $Type = "PN1F" ]
then
UType='PN1'; LType='pn1'
fi
pruductName=vn_${type}_v2.0.0_release
publishBaseUrl=http://xxxx/$newAppVersion/${LType}/${pruductName}
messageUrl=$publishBaseUrl/index.html?time=`date '+%s'`
androidUrl=$publishBaseUrl/${pruductName}_${UType}-${pruductName}.$revCount.apk
params="{\"msgtype\":\"actionCard\",\"actionCard\":{
\"title\":\"$newAppVersion ~_~打包通知\",
\"text\":\"## ${Type} : $newAppVersion

[**rev: $revCount**](http://10.88.0.15/videomaster_main/VideoDownloadMaster/branches) → [**jenkins: ${BUILD_NUMBER}**](${BUILD_URL}) [[**rebuild**](http://xxxx/build?delay=0sec) , [**changes**](http://xxxx/changes)]
*$branch*
>$SCM_CHANGELOGS \",\"singleTitle\":\"历史版本\",\"btnOrientation\":\"0\",\"singleURL\":\"$messageUrl\"}}"
curl 'https://oapi.dingtalk.com/robot/send?access_token=' \
-H 'Content-Type: application/json' \
-d "$params"
echo "build finish"