Skip to content

Commit c27f7f3

Browse files
committed
[#448] Update production path and use environment variable for app_id
1 parent 4b3a3a1 commit c27f7f3

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

.cicdtemplate/.codemagic/codemagic.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ definitions:
33
# This running machine can be changed depends on the billing plan: https://docs.codemagic.io/knowledge-codemagic/machine-type/
44
instance_type: mac_mini_m1
55
max_build_duration: 30
6+
environment:
7+
groups:
8+
- firebase_credentials
69
cache:
710
cache_paths:
811
- $HOME/.gradle/caches
912
scripts:
1013
- &set_up_google_services_files_from_environment_variables
1114
name: Set up google-services.json on template-compose
1215
script: |
13-
mkdir -p template-compose/app/
14-
echo $GOOGLE_SERVICES_JSON > template-compose/app/google-services.json
16+
mkdir -p template-compose/app/src/production
17+
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
1518
mkdir -p template-compose/app/src/staging
1619
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
1720
- &detekt_on_template_compose
@@ -88,9 +91,6 @@ workflows:
8891
build-and-deploy-template-compose-staging:
8992
name: Build and deploy template-compose staging to Firebase App Distribution
9093
<<: *configure_environment
91-
environment:
92-
groups:
93-
- firebase_credentials
9494
triggering:
9595
events:
9696
- push
@@ -111,17 +111,14 @@ workflows:
111111
firebase:
112112
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT_CREDENTIALS
113113
android:
114-
app_id: 1:215362241811:android:51e902760fcff1243446e6
114+
app_id: $FIREBASE_APP_ID_STAGING
115115
groups:
116116
- android-chapter
117117
artifact_type: 'apk'
118118

119119
build-and-deploy-template-compose-production:
120120
name: Build and deploy template-compose production to Firebase App Distribution
121121
<<: *configure_environment
122-
environment:
123-
groups:
124-
- firebase_credentials
125122
triggering:
126123
events:
127124
- push
@@ -142,7 +139,7 @@ workflows:
142139
firebase:
143140
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT_CREDENTIALS
144141
android:
145-
app_id: 1:215362241811:android:f4f209cd4a5f3d5b3446e6
142+
app_id: $FIREBASE_APP_ID_PRODUCTION
146143
groups:
147144
- android-chapter
148145
artifact_type: 'apk'

.cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
4545
GOOGLE_SERVICES_JSON_STAGING: ${{ secrets.GOOGLE_SERVICES_JSON_STAGING }}
4646
run: |
47-
mkdir -p template-compose/app
48-
echo $GOOGLE_SERVICES_JSON > template-compose/app/google-services.json
47+
mkdir -p template-compose/app/src/production
48+
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
4949
mkdir -p template-compose/app/src/staging
5050
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
5151

.cicdtemplate/.github/workflows/review_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
3737
GOOGLE_SERVICES_JSON_STAGING: ${{ secrets.GOOGLE_SERVICES_JSON_STAGING }}
3838
run: |
39-
mkdir -p template-compose/app
40-
echo $GOOGLE_SERVICES_JSON > template-compose/app/google-services.json
39+
mkdir -p template-compose/app/src/production
40+
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
4141
mkdir -p template-compose/app/src/staging
4242
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
4343

.github/workflows/review_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
5353
GOOGLE_SERVICES_JSON_STAGING: ${{ secrets.GOOGLE_SERVICES_JSON_STAGING }}
5454
run: |
55-
mkdir -p template-compose/app
56-
echo $GOOGLE_SERVICES_JSON > template-compose/app/google-services.json
55+
mkdir -p template-compose/app/src/production
56+
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
5757
mkdir -p template-compose/app/src/staging
5858
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
5959

codemagic.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ definitions:
1313
- &set_up_google_services_files_from_environment_variables
1414
name: Set up google-services.json on template-compose
1515
script: |
16-
mkdir -p template-compose/app/
17-
echo $GOOGLE_SERVICES_JSON > template-compose/app/google-services.json
16+
mkdir -p template-compose/app/src/production
17+
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
1818
mkdir -p template-compose/app/src/staging
1919
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
2020
- &detekt_on_template_compose
@@ -111,7 +111,7 @@ workflows:
111111
firebase:
112112
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT_CREDENTIALS
113113
android:
114-
app_id: 1:215362241811:android:51e902760fcff1243446e6
114+
app_id: $FIREBASE_APP_ID_STAGING
115115
groups:
116116
- android-chapter
117117
artifact_type: 'apk'
@@ -139,7 +139,7 @@ workflows:
139139
firebase:
140140
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT_CREDENTIALS
141141
android:
142-
app_id: 1:215362241811:android:f4f209cd4a5f3d5b3446e6
142+
app_id: $FIREBASE_APP_ID_PRODUCTION
143143
groups:
144144
- android-chapter
145145
artifact_type: 'apk'

0 commit comments

Comments
 (0)