diff --git a/publish-latest-branch-build.sh b/publish-latest-branch-build.sh index e511088..3cf9e21 100755 --- a/publish-latest-branch-build.sh +++ b/publish-latest-branch-build.sh @@ -1,95 +1,96 @@ #!/bin/sh ################################################################ # This script just take a built APK and move it to a directory # ################################################################ # # Currently in use here: # # https://gitpull.it/harbormaster/step/view/6/ # # -- Valerio B., Wed 26 Feb 2020 11:54:30 PM CET # ################################################################ # # Usage: the first argument is the Differential ID number # or empty if working on master. # # die on errors set -e # expected base URL EXPECTED_DEPLOY_URL=https://lab.reyboz.it/builds/libre-busto/ # pathname to the repository built apk file #APK_PATH=./build/outputs/apk/release/libre-busto-release-unsigned.apk -APK_PATH=./build/outputs/apk/debug/libre-busto-debug.apk +#APK_PATH=./app/build/outputs/apk/debug/libre-busto-debug.apk +APK_PATH=./app/build/outputs/apk/debug/app-debug.apk # repository build pathname BUILD_DIR=/home/www-data/reyboz.it/lab/builds/libre-busto # current directory CURRENT_DIR=$(pwd) # document id of the page to be commented document_id= # get the branch name branch_name=asd if [ -n "$1" ]; then # it's a Differential revision branch_name=D"$1" document_id="$branch_name" else # get a ref name (probably "HEAD") # remotes/origin/bigupdate remote_shit=$(git name-rev --name-only HEAD) # bigupdate branch_name=$(basename "$remote_shit") fi # give a name of this built apk APK_NAME="$branch_name"-libre-busto-unsigned.apk # complete build URL BUILD_URL="$EXPECTED_DEPLOY_URL""$APK_NAME" # pathname to the APK file in the HTTP build directory BUILD_APK_FILE="$BUILD_DIR"/"$APK_NAME" # pathname to the git show file in the HTTP build directory BUILD_GIT_SHOW_FILE="$BUILD_DIR"/"$branch_name"-git-show.txt # overwrite the latest built APK for this branch name (force date update) rm --force "$BUILD_APK_FILE" cp "$APK_PATH" "$BUILD_APK_FILE" # overwrite the latest git show for this branch name (force date update) rm --force "$BUILD_GIT_SHOW_FILE" git show > "$BUILD_GIT_SHOW_FILE" # update checksums cd "$BUILD_DIR" rm -f sha1sum.txt sha1sum * > sha1sum.txt cd - > /dev/null # show the build URL in the log echo "Published here:" echo "$BUILD_URL" # add a comment to the build URL if [ -n "$document_id" ] && [ -z "$NO_COMMENT" ]; then phab-comment.php "$document_id" "$BUILD_URL" fi # delete very old files find "$BUILD_DIR" -type f -mtime +120 -delete # clean old APK in the repository to never re-use it by mistake # as it happened when we moved everything to the /app directory rm "$APK_PATH"