Created
September 16, 2018 15:50
-
-
Save meyt/a43e78301bad232bf114291fed92b433 to your computer and use it in GitHub Desktop.
Android CI/CD Configuration for Gitlab (docker + alpine + gradle-cache + telegram notification)
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
image: alvrme/alpine-android:android-28 | |
stages: | |
- release | |
variables: | |
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | |
before_script: | |
- apk add --no-cache curl | |
- export GRADLE_USER_HOME=$(pwd)/.gradle | |
- echo "GRADLE_USER_HOME=${GRADLE_USER_HOME}" | |
- chmod +x ./gradlew | |
cache: | |
key: ${CI_PROJECT_ID} | |
paths: | |
- .gradle/wrapper | |
- .gradle/caches | |
build: | |
stage: release | |
script: | |
- ./gradlew clean assembleRelease | |
- curl -F chat_id="${tgBotChatId}" -F document=@"./presentation/build/outputs/apk/release/presentation-release-unsigned.apk" "https://api.telegram.org/bot${tgBotKey}/sendDocument" | |
artifacts: | |
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME" | |
expire_in: 2 weeks | |
paths: | |
- presentation/build/outputs/apk/release/*.apk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: Set
tgBotChatId
andtgBotKey
on Gitlab CI/CD Variables.Find chat ID: