代码拉取完成,页面将自动刷新
#!/bin/bash
VERSION_NAME=""
while [[ "$#" -gt 0 ]]; do
case $1 in
-versionname) VERSION_NAME="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
if [ -z "$VERSION_NAME" ]; then
echo "Please provide a version name using like \"-versionname v6.0.1\""
exit 1
fi
echo "Starting Gradle build...........................$VERSION_NAME"
./gradlew :bVNC-app:clean
./gradlew :bVNC-app:assembleRelease -PVersionName="$VERSION_NAME"
if [ $? -eq 0 ]; then
echo "Gradle build completed successfully."
else
echo "Error: Gradle build failed."
exit 1
fi
COMMIT_HASH=$(git rev-parse HEAD)
UPLOAD_TIME=$(date +"%Y-%m-%d %T")
UPLOAD_URL="YOUR_UPLOAD_URL"
# upload
#curl -F "file=@$APK_FILE" -F "version=$VERSION_NAME" -F "commit=$COMMIT_HASH" -F "upload_time=$UPLOAD_TIME" $UPLOAD_URL
if [ $? -eq 0 ]; then
echo "APK upload completed successfully."
else
echo "Error: Failed to upload APK."
exit 1
fi
INFO_FILE="build_info.txt"
echo "Version: $VERSION_NAME" > $INFO_FILE
echo "Commit: $COMMIT_HASH" >> $INFO_FILE
echo "Upload Time: $UPLOAD_TIME" >> $INFO_FILE
echo "Version: $VERSION_NAME"
echo "Commit: $COMMIT_HASH"
echo "Upload Time: $UPLOAD_TIME"
echo "All tasks completed successfully."
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。