2020. 1. 20. 07:35ㆍ안드로이드 개발
https://android.jlelse.eu/android-gitlab-ci-cd-sign-deploy-3ad66a8f24bf
The .gitlab-ci.yml file is completed and the result should look like this:
image: jangrewe/gitlab-ci-android
before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
stages:
- build
- test
- release
- deploy
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
testDebug:
stage: test
script:
- ./gradlew -Pci --console=plain :app:testDebug
assembleRelease:
stage: release
script:
- echo $KEYSTORE_FILE | base64 -d > my.keystore
- ./gradlew assembleRelease
-Pandroid.injected.signing.store.file=$(pwd)/my.keystore
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD
-Pandroid.injected.signing.key.alias=$KEY_ALIAS
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
artifacts:
paths:
- app/build/outputs/apk/release
- CHANGELOG
deployRelease:
image: python:3.5.2
stage: deploy
script:
- pip install requests
- git clone https://github.com/mega-arbuz/apk-release-deploy.git
- python apk-release-deploy/deploy.py
--release.dir=app/build/outputs/apk/release
--app.name=BestAppEver
--dropbox.token=$DROPBOX_TOKEN
--dropbox.folder=release
--changelog.file=CHANGELOG
--template.file=TEMPLATE
--zapier.hook=$ZAPIER_EMAIL_HOOK
--email.to=$EMAIL_TARGET
cache: {}
https://gitlab.com/arbuz/android-ci-cd
https://github.com/mega-arbuz/apk-release-deploy