diff --git a/.env.example b/.env.example index b48e9b3..cb2b64c 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,8 @@ TELEGRAM_BOT_TOKEN="this from Telegram bot father" TELEGRAM_CHAT_ID="this is a negative number for the Telegram group" KEYSTORE_FILE="/path/to/your/secret/keystore.jks" KEYSTORE_PASSPHRASE="this is the Java keystore password" + +ARTIFACTS_PATH=https://example.com/builds/libre-busto/ +ARTIFACTS_URL=/var/www/example.com/lab/builds/libre-busto diff --git a/bin/publish-latest-branch-build.php b/bin/publish-latest-branch-build.php index c0f8f07..490a5e5 100755 --- a/bin/publish-latest-branch-build.php +++ b/bin/publish-latest-branch-build.php @@ -1,233 +1,233 @@ #!/usr/bin/env php getPhorgeCommentLines() as $apk_line) { $phorge_apk_lines[] = $apk_line; } } $telegram_chat_content = implode("\n", array_merge([ $phorge_comment_header_lines, $phorge_apk_lines, ])); // Send message to Telegram groups. echo "DEBUG TELEGRAM CONTENT\n"; echo "$telegram_chat_content\n"; // Send message to your default Telegram group. // See the TELEGRAM_* environment variables. (new TelegramStupidSDK())->sendMessage($telegram_chat_content); // Send message to Phorge. echo "Adding bipbop Comment to $phorge_document_id\n"; shell_exec(sprintf( "~/bin/phab-comment.php %s %s %s", escapeshellarg($phorge_document_id), escapeshellarg($apk_destination_url), escapeshellarg($apk_sha256) )); } else { // We have NOT a Differentials revision under review! // So this is an atomic commit. $git_commit_title_escaped = escapeshellarg($git_commit_title); $telegram_chat_content = implode("\n", [ "🌚 New commit: *$git_commit_title_escaped*", "https://gitpull.it/R4:$git_commit", "", "Try this fresh test APK:", "[Download $apk_destination_name_escaped]($apk_destination_url_escaped)", "", "APK fingerprint sha256:", "`$apk_sha256`" ]); echo "DEBUG TELEGRAM CONTENT\n"; echo "$telegram_chat_content\n"; shell_exec(sprintf( "~/bin/telegram-comment.sh %s %s %s", escapeshellarg($TELEGRAM_BOT_TOKEN), escapeshellarg($TELEGRAM_CHAT_ID), escapeshellarg($telegram_chat_content) )); } // delete very old files print_log_info("Cleaning old artifacts"); shell_exec(sprintf( "find %s -type f -mtime +120 -delete", - escapeshellarg($EXPECTED_DEPLOY_PATH) + escapeshellarg($ARTIFACTS_PATH) )); print_log_info("Done");