Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -4,50 +4,50 @@
|
||||
|
||||
# Reusable script for building the Flutter app
|
||||
client-app-android-apk-build-script: &client-app-android-apk-build-script
|
||||
name: 👷 🤖 Build Client App APK (Android)
|
||||
name: Build Client App APK (Android)
|
||||
script: |
|
||||
dart pub global activate melos
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
make mobile-install
|
||||
make mobile-client-build PLATFORM=apk MODE=release
|
||||
make mobile-client-build PLATFORM=apk MODE=release ENV=$ENV
|
||||
|
||||
client-app-ios-build-script: &client-app-ios-build-script
|
||||
name: 👷 🍎 Build Client App (iOS)
|
||||
name: Build Client App (iOS)
|
||||
script: |
|
||||
dart pub global activate melos
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
make mobile-install
|
||||
make mobile-client-build PLATFORM=ios MODE=release
|
||||
make mobile-client-build PLATFORM=ios MODE=release ENV=$ENV
|
||||
|
||||
staff-app-android-apk-build-script: &staff-app-android-apk-build-script
|
||||
name: 👷 🤖 Build Staff App APK (Android)
|
||||
name: Build Staff App APK (Android)
|
||||
script: |
|
||||
dart pub global activate melos
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
make mobile-install
|
||||
make mobile-staff-build PLATFORM=apk MODE=release
|
||||
make mobile-staff-build PLATFORM=apk MODE=release ENV=$ENV
|
||||
|
||||
staff-app-ios-build-script: &staff-app-ios-build-script
|
||||
name: 👷 🍎 Build Staff App (iOS)
|
||||
name: Build Staff App (iOS)
|
||||
script: |
|
||||
dart pub global activate melos
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
make mobile-install
|
||||
make mobile-staff-build PLATFORM=ios MODE=release
|
||||
make mobile-staff-build PLATFORM=ios MODE=release ENV=$ENV
|
||||
|
||||
# Reusable script for distributing Android to Firebase
|
||||
distribute-android-script: &distribute-android-script
|
||||
name: 🚛 🤖 Distribute Android to Firebase App Distribution
|
||||
name: Distribute Android to Firebase App Distribution
|
||||
script: |
|
||||
# Distribute Android APK
|
||||
# Note: Using wildcards to catch app-release.apk
|
||||
APP_PATH=$(find apps/mobile/apps -name "app-release.apk" | head -n 1)
|
||||
# Note: With flavors the APK is in a flavor-specific subdirectory
|
||||
APP_PATH=$(find apps/mobile/apps -name "app-${ENV}-release.apk" -o -name "app-release.apk" | head -n 1)
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "No APK found!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Found APK at: $APP_PATH"
|
||||
|
||||
|
||||
firebase appdistribution:distribute "$APP_PATH" \
|
||||
--app $FIREBASE_APP_ID_ANDROID \
|
||||
--release-notes "Build $FCI_BUILD_NUMBER - Environment: $ENV" \
|
||||
@@ -56,7 +56,7 @@ distribute-android-script: &distribute-android-script
|
||||
|
||||
# Reusable script for distributing iOS to Firebase
|
||||
distribute-ios-script: &distribute-ios-script
|
||||
name: 🚛🍎 Distribute iOS to Firebase App Distribution
|
||||
name: Distribute iOS to Firebase App Distribution
|
||||
script: |
|
||||
# Distribute iOS
|
||||
IPA_PATH=$(find apps/mobile/apps -name "*.ipa" | head -n 1)
|
||||
@@ -74,7 +74,7 @@ distribute-ios-script: &distribute-ios-script
|
||||
|
||||
# Reusable script for web quality checks
|
||||
web-quality-script: &web-quality-script
|
||||
name: ✅ Web Quality Checks
|
||||
name: Web Quality Checks
|
||||
script: |
|
||||
npm install -g pnpm
|
||||
cd apps/web
|
||||
@@ -85,7 +85,7 @@ web-quality-script: &web-quality-script
|
||||
|
||||
# Reusable script for mobile quality checks
|
||||
mobile-quality-script: &mobile-quality-script
|
||||
name: ✅ Mobile Quality Checks
|
||||
name: Mobile Quality Checks
|
||||
script: |
|
||||
dart pub global activate melos
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
@@ -98,7 +98,7 @@ workflows:
|
||||
# Quality workflow (Web + Mobile)
|
||||
# =================================================================================
|
||||
quality-gates-dev:
|
||||
name: ✅ Quality Gates (Dev)
|
||||
name: Quality Gates (Dev)
|
||||
working_directory: .
|
||||
instance_type: mac_mini_m2
|
||||
max_build_duration: 60
|
||||
@@ -129,7 +129,7 @@ workflows:
|
||||
artifacts:
|
||||
- apps/mobile/apps/client/build/app/outputs/flutter-apk/*.apk
|
||||
- apps/mobile/apps/client/build/ios/ipa/*.ipa
|
||||
- apps/mobile/apps/client/build/app/outputs/bundle/release/app-release.aab
|
||||
- apps/mobile/apps/client/build/app/outputs/bundle/**/*.aab
|
||||
- /tmp/xcodebuild_logs/*.log
|
||||
- flutter_drive.log
|
||||
cache:
|
||||
@@ -153,7 +153,7 @@ workflows:
|
||||
artifacts:
|
||||
- apps/mobile/apps/staff/build/app/outputs/flutter-apk/*.apk
|
||||
- apps/mobile/apps/staff/build/ios/ipa/*.ipa
|
||||
- apps/mobile/apps/staff/build/app/outputs/bundle/release/app-release.aab
|
||||
- apps/mobile/apps/staff/build/app/outputs/bundle/**/*.aab
|
||||
- /tmp/xcodebuild_logs/*.log
|
||||
- flutter_drive.log
|
||||
cache:
|
||||
@@ -167,7 +167,7 @@ workflows:
|
||||
# =================================================================================
|
||||
client-app-dev-android:
|
||||
<<: *client-app-base
|
||||
name: 🚛 🤖 Client App Dev (Android App Distribution)
|
||||
name: Client App Dev (Android App Distribution)
|
||||
environment:
|
||||
flutter: stable
|
||||
xcode: latest
|
||||
@@ -184,7 +184,7 @@ workflows:
|
||||
|
||||
client-app-staging-android:
|
||||
<<: *client-app-base
|
||||
name: 🚛🤖 Client App Staging (Android App Distribution)
|
||||
name: Client App Staging (Android App Distribution)
|
||||
environment:
|
||||
flutter: stable
|
||||
xcode: latest
|
||||
@@ -194,23 +194,19 @@ workflows:
|
||||
android_signing:
|
||||
- keystore: KROW_CLIENT_STAGING
|
||||
vars:
|
||||
ENV: staging
|
||||
ENV: stage
|
||||
scripts:
|
||||
- *client-app-android-apk-build-script
|
||||
- *distribute-android-script
|
||||
|
||||
client-app-prod-android:
|
||||
<<: *client-app-base
|
||||
name: 🚛 🤖 Client App Prod (Android App Distribution)
|
||||
name: Client App Prod (Android App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- client_app_prod_credentials
|
||||
android_signing:
|
||||
- keystore: KROW_CLIENT_PROD
|
||||
keystore_environment_variable: CM_KEYSTORE_PATH_CLIENT
|
||||
keystore_password_environment_variable: CM_KEYSTORE_PASSWORD_CLIENT
|
||||
key_alias_environment_variable: CM_KEY_ALIAS_CLIENT
|
||||
key_password_environment_variable: CM_KEY_PASSWORD_CLIENT
|
||||
vars:
|
||||
ENV: prod
|
||||
scripts:
|
||||
@@ -222,7 +218,7 @@ workflows:
|
||||
# =================================================================================
|
||||
client-app-dev-ios:
|
||||
<<: *client-app-base
|
||||
name: 🚛 🍎 Client App Dev (iOS App Distribution)
|
||||
name: Client App Dev (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- client_app_dev_credentials
|
||||
@@ -234,19 +230,19 @@ workflows:
|
||||
|
||||
client-app-staging-ios:
|
||||
<<: *client-app-base
|
||||
name: 🚛 🍎 Client App Staging (iOS App Distribution)
|
||||
name: Client App Staging (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- client_app_staging_credentials
|
||||
vars:
|
||||
ENV: staging
|
||||
ENV: stage
|
||||
scripts:
|
||||
- *client-app-ios-build-script
|
||||
- *distribute-ios-script
|
||||
|
||||
client-app-prod-ios:
|
||||
<<: *client-app-base
|
||||
name: 🚛 🍎 Client App Prod (iOS App Distribution)
|
||||
name: Client App Prod (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- client_app_prod_credentials
|
||||
@@ -261,7 +257,7 @@ workflows:
|
||||
# =================================================================================
|
||||
staff-app-dev-android:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🤖 👨🍳 Staff App Dev (Android App Distribution)
|
||||
name: Staff App Dev (Android App Distribution)
|
||||
environment:
|
||||
flutter: stable
|
||||
xcode: latest
|
||||
@@ -278,7 +274,7 @@ workflows:
|
||||
|
||||
staff-app-staging-android:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🤖 👨🍳 Staff App Staging (Android App Distribution)
|
||||
name: Staff App Staging (Android App Distribution)
|
||||
environment:
|
||||
flutter: stable
|
||||
xcode: latest
|
||||
@@ -288,14 +284,14 @@ workflows:
|
||||
android_signing:
|
||||
- keystore: KROW_STAFF_STAGING
|
||||
vars:
|
||||
ENV: staging
|
||||
ENV: stage
|
||||
scripts:
|
||||
- *staff-app-android-apk-build-script
|
||||
- *distribute-android-script
|
||||
|
||||
staff-app-prod-android:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🤖 👨🍳 Staff App Prod (Android App Distribution)
|
||||
name: Staff App Prod (Android App Distribution)
|
||||
environment:
|
||||
flutter: stable
|
||||
xcode: latest
|
||||
@@ -315,7 +311,7 @@ workflows:
|
||||
# =================================================================================
|
||||
staff-app-dev-ios:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🍎 👨🍳 Staff App Dev (iOS App Distribution)
|
||||
name: Staff App Dev (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- staff_app_dev_credentials
|
||||
@@ -327,19 +323,19 @@ workflows:
|
||||
|
||||
staff-app-staging-ios:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🍎 👨🍳 Staff App Staging (iOS App Distribution)
|
||||
name: Staff App Staging (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- staff_app_staging_credentials
|
||||
vars:
|
||||
ENV: staging
|
||||
ENV: stage
|
||||
scripts:
|
||||
- *staff-app-ios-build-script
|
||||
- *distribute-ios-script
|
||||
|
||||
staff-app-prod-ios:
|
||||
<<: *staff-app-base
|
||||
name: 🚛 🍎 👨🍳 Staff App Prod (iOS App Distribution)
|
||||
name: Staff App Prod (iOS App Distribution)
|
||||
environment:
|
||||
groups:
|
||||
- staff_app_prod_credentials
|
||||
@@ -348,4 +344,3 @@ workflows:
|
||||
scripts:
|
||||
- *staff-app-ios-build-script
|
||||
- *distribute-ios-script
|
||||
|
||||
|
||||
Reference in New Issue
Block a user