Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.05 KB
Newer Older
1

Nandhika Prayoga's avatar
Nandhika Prayoga committed
2
image: nezappl/mobile
3

4
cache:
5
  key: ${CI_COMMIT_REF_SLUG}
6
7
8
9
10
  paths:
    - node_modules/
    - android/
    - ios/

11
stages:
12
  - test
13
  - build
Nandhika Prayoga's avatar
Nandhika Prayoga committed
14

15
16
17
18
19
20
21
22
test:
  stage: test
  script:
    - npm i
    - npm test -- --coverage --watchAll=false
  only:
    - staging
    - master
23

24
25
build:
  stage: build
26
  before_script:
27
28
29
    - export ANDROID_SDK_ROOT=/usr/lib/android-sdk
    - export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
    - export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
30
  script:
31
    - npm i
32
    - cd android
33
    - echo -e "RELEASE_STORE_FILE=${RELEASE_STORE_FILE}\nRELEASE_STORE_PASSWORD=${RELEASE_STORE_PASSWORD}\nRELEASE_KEY_ALIAS=${RELEASE_KEY_ALIAS}\nRELEASE_KEY_PASSWORD=${RELEASE_KEY_PASSWORD}" >> local.properties
Nandhika Prayoga's avatar
Nandhika Prayoga committed
34
    - cat local.properties
35
    - chmod +x gradlew && ./gradlew assembleRelease
36
    - cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
37
38
39
  artifacts:
    name: "$CI_PROJECT_NAME-$PLATFORM-$CI_COMMIT_REF_NAME"
    paths:
40
      - $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
41
  only:
42
43
    - staging
    - master