Created
February 21, 2020 11:00
-
-
Save saschpe/ecb33a36a7bb887572ce5dfa80337713 to your computer and use it in GitHub Desktop.
Ein Beispiel basierend auf Gitlab CI
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: saschpe/android-sdk:29_29.0.2 | |
stages: | |
- prepare | |
- build | |
- test | |
- integration | |
- release | |
- deploy | |
## Prepare stage | |
docker:ci-firebase: | |
image: docker:stable | |
services: | |
- docker:dind | |
stage: prepare | |
script: | |
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY | |
- cd config/docker-ci-firebase/ | |
- docker build -t $CI_REGISTRY/lunchup/lunchup.android/ci-firebase:latest . | |
- docker push $CI_REGISTRY/lunchup/lunchup.android/ci-firebase:latest | |
only: | |
refs: | |
- master | |
changes: | |
- config/docker-ci-firebase/Dockerfile | |
## Build stage | |
assembleDebug: | |
stage: build | |
script: | |
- ./gradlew assembleDebug :mobile:assembleAndroidTest | |
artifacts: | |
expire_in: 1 day | |
paths: | |
- "*/build/**" | |
lintDebug: | |
stage: build | |
script: | |
- ./gradlew lintDebug | |
artifacts: | |
paths: | |
- "*/build/reports/lint-results*" | |
spotless: | |
stage: build | |
script: | |
- ./gradlew spotlessCheck | |
## Test stage | |
testDebug: | |
stage: test | |
script: | |
- ./gradlew testDebug | |
dependencies: | |
- assembleDebug | |
artifacts: | |
reports: | |
junit: "*/build/test-results/**/TEST-*.xml" | |
## Integration stage | |
.firebase_template: &firebase | |
image: registry.gitlab.com/lunchup/lunchup.android/ci-firebase | |
stage: integration | |
only: | |
- schedules # Only manual for now | |
cache: {} | |
dependencies: | |
- assembleDebug | |
environment: | |
name: testing | |
url: https://console.firebase.google.com/project/lunchup-1/testlab | |
firebaseInstrumentation: | |
<<: *firebase | |
script: | |
- ./scripts/secret decrypt --password ${SECRETS_KEY} --firebase | |
- ./scripts/firebase/test-lab | |
--service-account config/firebase-test-lab-ci.json | |
--type instrumentation | |
firebaseRobo: | |
<<: *firebase | |
script: | |
- ./scripts/secret decrypt --password ${SECRETS_KEY} --firebase | |
- ./scripts/firebase/test-lab | |
--service-account config/firebase-test-lab-ci.json | |
--type robo | |
## Release stage | |
assembleRelease: | |
stage: release | |
only: | |
- master | |
script: | |
- ./scripts/secret decrypt --password ${SECRETS_KEY} --signing | |
- ./gradlew bundleRelease | |
dependencies: [] | |
artifacts: | |
paths: | |
- "*/build/outputs/**" | |
## Deploy stage | |
playStorePublish: | |
stage: deploy | |
only: | |
- master | |
script: | |
- ./scripts/secret decrypt --password ${SECRETS_KEY} --signing | |
- ./scripts/play-store/publish-app | |
cache: {} | |
dependencies: | |
- assembleRelease | |
environment: | |
name: staging | |
url: https://play.google.com/apps/publish/?account=5557074937523405965#AppDashboardPlace:p=io.lunchup.android&appid=4975960815197857304 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment