.gitlab-ci.yml 3.72 KB
Newer Older
Davide De Rosa's avatar
Davide De Rosa committed
1
2
3
4
5
6
7
8
9
10
variables:
    LC_ALL: "en_US.UTF-8"
    LANG: "en_US.UTF-8"
    STAGE_BUILD_PATH: "build"
    STAGE_ARTIFACTS_PATH: "dist"
    STAGE_ARCHIVE_NAME: "pia-vpn"
    SERIALIZED_ARCHIVE_JSON: "$STAGE_ARTIFACTS_PATH/notify.json"

before_script:
    - gem install bundler --no-ri --no-rdoc
11
    #- bundle install
Davide De Rosa's avatar
Davide De Rosa committed
12
    - bundle update
13
    #- bundle exec fastlane run ensure_git_status_clean
14
    - echo "$PIA_STAGING_ENDPOINT" >"Resources/staging.endpoint"
15
    - echo "$PIA_CUSTOM_SERVERS" >"Resources/custom.servers"
Davide De Rosa's avatar
Davide De Rosa committed
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

stages:
    - test
    - archive
    - deploy
    - notify

# hidden
.unit_test:
    stage: test
    variables:
        SCAN_SCHEME: "PIA VPN dev"
        SCAN_DEVICES: "iPhone X"
    script:
        - bundle exec fastlane unit_test
    only:
        - branches
    except:
        - master
    tags:
        - ios

qa_archive:
    stage: archive
    variables:
        MATCH_TYPE: "adhoc"
42
43
        GYM_SCHEME: "PIA VPN dev"
        GYM_EXPORT_METHOD: "ad-hoc"
Davide De Rosa's avatar
Davide De Rosa committed
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
    script:
        - bundle exec fastlane create_archive
    artifacts:
        paths:
            - "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.*"
        expire_in: 1 week
    only:
        - develop
    tags:
        - ios

qa_deploy:
    stage: deploy
    variables:
        IPA_OUTPUT_PATH: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
        FL_HOCKEY_IPA: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
        FL_HOCKEY_COMMIT_SHA: $CI_COMMIT_SHA
        FL_HOCKEY_BUILD_SERVER_URL: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID"
        FL_HOCKEY_REPOSITORY_URL: $CI_PROJECT_URL
        FL_HOCKEY_NOTIFY: "false"
        FL_HOCKEY_STRATEGY: "replace"
    script:
        - bundle exec fastlane qa_deploy
    environment:
        name: "hockey"
        url: $HOCKEY_URL
    artifacts:
        paths:
            - $SERIALIZED_ARCHIVE_JSON
        expire_in: 1 week
    only:
        - develop
    tags:
        - ios

qa_notify:
    stage: notify
    variables:
        FL_SLACK_USERNAME: "HockeyApp"
        GITLAB_CHANGELOG_ISSUE_FORMAT: "- #%{id}: <%{url}|%{desc}>"
    dependencies:
        - qa_deploy
    script:
        - bundle exec fastlane qa_notify
    when:
        manual
    only:
        - develop
    tags:
        - ios

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
beta_manual_archive:
    stage: archive
    variables:
        MATCH_TYPE: "appstore"
        GYM_SCHEME: "PIA VPN"
        GYM_EXPORT_METHOD: "app-store"
    script:
        #- bundle exec fastlane clean_openssl
        - bundle exec fastlane create_archive
    artifacts:
        paths:
            - "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.*"
        expire_in: 1 week
    when:
        manual
    only:
Jose Blaya's avatar
Jose Blaya committed
111
        - /^release.*$/
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    tags:
        - ios

beta_manual_deploy:
    stage: deploy
    variables:
        PILOT_IPA: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
        PILOT_DISTRIBUTE_EXTERNAL: "true"
        DEMO_ACCOUNT_REQUIRED: "true"
    script:
        - bundle exec fastlane beta_deploy
    environment:
        name: "testflight"
    when:
        manual
    only:
Jose Blaya's avatar
Jose Blaya committed
128
        - /^release.*$/
129
130
131
    tags:
        - ios

Davide De Rosa's avatar
Davide De Rosa committed
132
133
134
135
beta_archive:
    stage: archive
    variables:
        MATCH_TYPE: "appstore"
136
137
        GYM_SCHEME: "PIA VPN"
        GYM_EXPORT_METHOD: "app-store"
Davide De Rosa's avatar
Davide De Rosa committed
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
    script:
        #- bundle exec fastlane clean_openssl
        - bundle exec fastlane create_archive
    artifacts:
        paths:
            - "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.*"
        expire_in: 1 week
    only:
        - master
    tags:
        - ios

beta_deploy:
    stage: deploy
    variables:
        PILOT_IPA: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
        PILOT_DISTRIBUTE_EXTERNAL: "true"
        DEMO_ACCOUNT_REQUIRED: "true"
    script:
        - bundle exec fastlane beta_deploy
    environment:
        name: "testflight"
    only:
        - master
    tags:
        - ios