Commit 0e502f03 by 王岩

tij

parent e5ab4a92
{"sendno":"0","msg_id":"18100799148795938"}
\ No newline at end of file
#!/bin/sh
echo "delpoy是是是"
#日志输入
log() {
case $2 in
"success")
echo -e "\e[1;32m $1 \e[0m"
;;
"info")
echo -e "\e[1;37m $1 \e[0m"
;;
"warning")
echo -e "\e[1;33m $1 \e[0m"
;;
"error")
echo -e "\e[1;31m $1 \e[0m"
;;
*)
echo -e "\e[1;37m $1 \e[0m"
;;
esac
}
echo "$@"
#获取当前分支名称
get_current_branch() {
branch=''
message="delepoy:v2.3.0"
# 尝试使用git symbolic-ref HEAD获取
branch=$(git symbolic-ref HEAD | sed -e 's/^refs\/heads\/\(.*\)$/\1/')
echo "$message"
\ No newline at end of file
# 若失败,尝试git rev-parse --abbrev-ref HEAD
if [ -z "$branch" ]; then
branch=$(git rev-parse --abbrev-ref HEAD)
fi
# 若还失败,使用git branch提取带*号的当前分支
if [ -z "$branch" ]; then
branch=$(git branch | sed -n '/^.*/s/^\* \(.*\)/\1/p')
fi
echo $branch
}
#发送消息通知
jPush() {
curl "https://api.jpush.cn/v3/push" \
-H "Authorization: Basic YjhiNjcyZmY3MjkyNjM1MTkzZjFhNjgwOmJmYWExYTg3YTEwZTNlMTJjNTI0ZmI0OQ==" \
-H "Content-Type: text/plain;charset=UTF-8" \
-d '{"platform":["android", "ios"],"audience":{"alias":["test_83916"]},"message":{"title":"Update","msg_content":"Update"}}' \
--compressed > $message
echo $message
if [ $? -ne 0 ];then
log $? "error"
exit 1
else
log "更新通知发送成功" "success"
fi
}
jPush
# main() {
# }
{"sendno":"0","msg_id":"18100799120263129"}{"sendno":"0","msg_id":"18100799143165541"}{"sendno":"0","msg_id":"18100799143532321"}
\ No newline at end of file
{
"android_version": "2.3.0+19",
"android_version": "2.3.4+1",
"android_forceUpdate": false,
"android_msg": "2.2.0相关内容",
"android_url": "https://gitlab.gzsle.com/wangyan/upgradeSFA/raw/test/app.apk",
......
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