-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
102 lines (93 loc) · 2.18 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Baldissera image of android container.
image: baldissera/android-container:2.1
variables:
DOCKER_DRIVER: overlay2
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
before_script:
- export ANDROID_HOME="/usr/local/android-sdk"
# GitLab CI Stages executed in this CI
stages:
- test
- build
- deploy
# Static Analysis for avaliate code smells
static_analysis:
stage: test
before_script:
- cd project/
- mv ../docker/static_analysis.sh ./static_analysis.sh
- chmod +x ./static_analysis.sh
script:
- ./static_analysis.sh
# Run Unit Tests, verifying the code coverage
unit_test:
stage: test
before_script:
- cd project/
- mv ../docker/test.sh ./test.sh
- chmod +x ./test.sh
script:
- ./test.sh
artifacts:
name: "reports_${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}_unit_test"
when: always
expire_in: 2 days
paths:
- project/app/build/reports/jacocoTestReport/html
# Build script for generate new .APK
build:
stage: build
before_script:
- cd project/
- git clone $KEY_STORE_REPO ./key
- mv ./key/$STORE_FILE ./app/
- mv ../docker/build.sh ./build.sh
- chmod +x ./build.sh
script:
- fastlane update_build_number
- ./build.sh
after_script:
- rm -Rf ./app/.git/
- rm ./app/$STORE_FILE
artifacts:
paths:
- project/app/build/outputs/apk
only:
- tags
- dev
# Build of GitHub Pages
pages:
stage: build
before_script:
- git config user.email "<[email protected]>"
- git config --global user.name "Baldissera"
script:
- mkdocs build
- git add site/
- git commit -m"Build new Pages with $CI_PIPELINE_ID"
- git push https://$GITHUB_USERNAME:[email protected]/fga-gpp-mds/2018.1_Nexte.git `git subtree split --prefix site/`:gh-pages --force
only:
- dev
# Deploy to PlayStore in Beta Version
deploy_beta:
stage: deploy
before_script:
- cd project/
- echo $DEPLOY_KEY_FILE >> key.json
script:
- fastlane beta
after_script:
- rm key.json
dependencies:
- build
artifacts:
paths:
- fastlane/logs
only:
- tags
# Cache for use on next executions
cache:
key: ${CI_PROJECT_ID}2
paths:
- .gradle/