auto submit to dev.bukkit.org

Former-commit-id: ca9ea953c6c34342f0ab43f873c69d4e9dfdc82e [formerly b3ad58412805e8ec5af4309a1da9e46f46818a89]
Former-commit-id: 52fae4aba36f46292ff46d19de56f4dc77baddff
This commit is contained in:
Ghost_chu committed 2019-05-03 15:04:12 +08:00
1 parent d1acb080b9
commit 43dde0246c
1 file changed
+34
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
echo "Deploy jar to dev.bukkit.org"
# 获取从install完成后输出的JAR文件的名字
filename="./jarname.txt"
if [ ! -f $filename ]
then
echo "The file $filename doesn't exist."
exit 1
fi
# 定义变量count,其值为0
count=0
# 下载JSON库
wget -O "jq" "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
# 设置运行权限
chmod +x "./jq"
# JAR为编译后jar文件名称
read JAR < $filename
# 将变量count的值加1
xToken=$1
xUJson='{"changelog":"Auto upload by TravisCI, see update details on spigotmc.org","changelogType":["text","markdown"],"gameVersions":[7330,7132,7081],"releaseType":"release"}'
curl -X POST -H "X-Api-Token: $xToken" -F "meta=$xUJson" -F "file=@./push/$JAR" -s "https://dev.bukkit.org/api/projects/320536/upload-file" > fileid.json
cat fileid.json
jq '.id' > fileid.txt
cat fileid.txt
echo -e "\nTotal $count linces read and deployed."
#退出脚本,且退出状态码为0
exit 0