-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated to recent android sdk updated gradle to 4.6 update kotlin updated dependencies compile fix * update kotlin * disable hyphenation on line number textview and codeeditor as well * updated kotlin updated dependency * added travis-telegram-bot added missing travis files to git * use variable for GitHub url and Travis url * also push messages for master branch * test * test * additional telegram variable * apk file path now uses absolute path * fix bot id
- Loading branch information
1 parent
0d3fdde
commit 3e23f6f
Showing
10 changed files
with
129 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Sat Aug 25 17:52:39 CEST 2018 | ||
#Tue Oct 23 14:05:42 CEST 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Travis Container environment variables:" | ||
env | sort | ||
|
||
echo | ||
|
||
if [[ "${TRAVIS_BRANCH}" =~ "${TELEGRAM_BRANCHES}" ]]; then | ||
echo "Start compiling and assembling apk..." | ||
./gradlew clean testDebug lintDebug assembleDebug --stacktrace | ||
else | ||
echo "Start compiling WITHOUT assembling apk..." | ||
./gradlew clean testDebug lintDebug --stacktrace | ||
fi | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
if [[ "${TRAVIS_BRANCH}" =~ "${TELEGRAM_BRANCHES}" ]]; then | ||
echo "Generating Telegram Messages..." | ||
|
||
BASE_URL="https://api.telegram.org/bot${TELEGRAM_TOKEN}" | ||
|
||
# prepare telegram message to send as reply to the apk file | ||
if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then | ||
PR_LINK_TEXT=$(cat <<EOF | ||
[Pull Request](${GITHUB_URL}/pull/${TRAVIS_PULL_REQUEST}) | ||
EOF | ||
) | ||
fi | ||
|
||
if [[ "${TRAVIS_TEST_RESULT}" == "0" ]]; then | ||
RESULT_EMOJI="✅" | ||
else | ||
RESULT_EMOJI="🔥" | ||
fi | ||
|
||
COMMITS_INVOLVED=$(git log --oneline ${TRAVIS_COMMIT_RANGE}) | ||
|
||
MESSAGE=$(cat <<EOF | ||
${RESULT_EMOJI} *Travis Build* [#${TRAVIS_BUILD_NUMBER}](https://travis-ci.org/${TRAVIS_URL}/builds/${TRAVIS_BUILD_ID}) *(${TRAVIS_EVENT_TYPE})* | ||
Commits: | ||
\`${COMMITS_INVOLVED}\` | ||
${PR_LINK_TEXT} | ||
EOF | ||
) | ||
|
||
if [[ "${TRAVIS_TEST_RESULT}" == "0" ]]; then | ||
# find compiled .apk file | ||
APK_FILE=$(find "${TRAVIS_BUILD_DIR}/app/build/outputs/apk/debug" -type f -name "*.apk") | ||
|
||
echo "Sending apk file..." | ||
|
||
# send apk file via telegram bot | ||
MESSAGE_ID=$(curl \ | ||
--silent \ | ||
--form chat_id="${CHAT_ID}" \ | ||
--form document=@"${APK_FILE}" \ | ||
"${BASE_URL}/sendDocument" \ | ||
| jq 'if (.ok == true) then .result.message_id else empty end') | ||
fi | ||
|
||
echo "Sending info message..." | ||
# send telegram chat message | ||
curl \ | ||
--silent \ | ||
-X POST \ | ||
"${BASE_URL}/sendMessage" \ | ||
-d "chat_id=${CHAT_ID}" \ | ||
-d "text=${MESSAGE}" \ | ||
-d "reply_to_message_id=${MESSAGE_ID}" \ | ||
-d "parse_mode=markdown" \ | ||
-d "disable_web_page_preview=true" \ | ||
>/dev/null | ||
|
||
fi | ||
|