README.md 698 Bytes
Newer Older
Jan Grewe's avatar
Jan Grewe committed
1
2
3
4
5
6
# gitlab-ci-android
This Docker image contains the Android SDK and most common packages necessary for building Android apps in a CI tool like GitLab CI. Make sure your CI environment's caching works as expected, this greatly improves the build time, especially if you use multiple build jobs.

A `.gitlab-ci.yml` with caching of your project's dependencies would look like this:

```
Jan Grewe's avatar
Jan Grewe committed
7
image: jangrewe/gitlab-ci-android
Jan Grewe's avatar
Jan Grewe committed
8
9
10
11
12
13
14
15
16
17
18
19

stages:
- build

before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
  - .gradle/
Jan Grewe's avatar
Jan Grewe committed
20

Jan Grewe's avatar
Jan Grewe committed
21
build:
Jan Grewe's avatar
Jan Grewe committed
22
  stage: build
Jan Grewe's avatar
Jan Grewe committed
23
24
25
26
27
28
  script:
  - ./gradlew assembleDebug
  artifacts:
    paths:
    - app/build/outputs/apk/app-debug.apk
```