diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b74decb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/config.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..26eef6a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Gradle from F-Droid diff --git a/config-example.php b/config-example.php new file mode 100644 index 0000000..4e59a02 --- /dev/null +++ b/config-example.php @@ -0,0 +1,3 @@ + $argv[1], + 'transactions' => [ + [ + 'type' => 'comment', + 'value' => sprintf( + "{icon cog spin} Be bop be bop. I'm a bot. Builded:\n\n→ [[%1\$s|%2\$s]]", + + $argv[2], + $filename + ), + ] + ], +]; + +$client = new ConduitClient('https://gitpull.it/'); +$client->setConduitToken(PHABRICATOR_API_TOKEN); + +try { + $result = $client->callMethodSynchronous('differential.revision.edit', $api_parameters); + //print_r($result); +} catch( Exception $e ) { + print_r( $api_parameters ); + echo "ERROR COMMENTING: " . $e->getMessage() . "\n"; +} diff --git a/publish-latest-branch-build.sh b/publish-latest-branch-build.sh new file mode 100755 index 0000000..fb0b55c --- /dev/null +++ b/publish-latest-branch-build.sh @@ -0,0 +1,91 @@ +#!/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 + +# 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 diff --git a/update-gradle-run-after-first-successfull-build.sh b/update-gradle-run-after-first-successfull-build.sh new file mode 100755 index 0000000..c074dd3 --- /dev/null +++ b/update-gradle-run-after-first-successfull-build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +chown root: -R /opt/reyboz/android/android-sdk diff --git a/update-gradle.sh b/update-gradle.sh new file mode 100755 index 0000000..fa880c1 --- /dev/null +++ b/update-gradle.sh @@ -0,0 +1,3 @@ +#!/bin/sh +wget https://raw.githubusercontent.com/f-droid/fdroidserver/master/gradlew-fdroid -O gradle +chown phabricator-android-builder: -R /opt/reyboz/android/android-sdk