-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from onestudio-co/Virtual-branch
Virtual branch
- Loading branch information
Showing
29 changed files
with
337 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"flutter":{"platforms":{"android":{"buildConfigurations":{"src/production":{"projectId":"flutter-bond-8ae02","appId":"1:1077101979846:android:00afb3c0b4d1b8ae3a0fc7","fileOutput":"android/app/src/production/google-services.json"},"src/staging":{"projectId":"flutter-bond-staging-7dd42","appId":"1:390157281889:android:bf4d85c3c9a51044ab9820","fileOutput":"android/app/src/staging/google-services.json"}}},"ios":{"buildConfigurations":{"Debug-Production":{"projectId":"flutter-bond-8ae02","appId":"1:1077101979846:ios:a2d61d584196a5be3a0fc7","uploadDebugSymbols":true,"fileOutput":"ios/Production/GoogleService-Info.plist"},"Release-Production":{"projectId":"flutter-bond-8ae02","appId":"1:1077101979846:ios:a2d61d584196a5be3a0fc7","uploadDebugSymbols":true,"fileOutput":"ios/Production/GoogleService-Info.plist"},"Debug-Staging":{"projectId":"flutter-bond-staging-7dd42","appId":"1:390157281889:ios:8c87b8875dcdd94aab9820","uploadDebugSymbols":true,"fileOutput":"ios/Staging/GoogleService-Info.plist"},"Release-Staging":{"projectId":"flutter-bond-staging-7dd42","appId":"1:390157281889:ios:8c87b8875dcdd94aab9820","uploadDebugSymbols":true,"fileOutput":"ios/Staging/GoogleService-Info.plist"}}},"macos":{"buildConfigurations":{"Debug-Production":{"projectId":"flutter-bond-8ae02","appId":"1:1077101979846:ios:bb43f2ef1264d0e03a0fc7","uploadDebugSymbols":true,"fileOutput":"macos/Production/GoogleService-Info.plist"},"Release-Production":{"projectId":"flutter-bond-8ae02","appId":"1:1077101979846:ios:bb43f2ef1264d0e03a0fc7","uploadDebugSymbols":true,"fileOutput":"macos/Production/GoogleService-Info.plist"},"Debug-Staging":{"projectId":"flutter-bond-staging-7dd42","appId":"1:390157281889:ios:ba7ec93993371072ab9820","uploadDebugSymbols":true,"fileOutput":"macos/Staging/GoogleService-Info.plist"},"Release-Staging":{"projectId":"flutter-bond-staging-7dd42","appId":"1:390157281889:ios:ba7ec93993371072ab9820","uploadDebugSymbols":true,"fileOutput":"macos/Staging/GoogleService-Info.plist"}}},"dart":{"lib/firebase_options_production.dart":{"projectId":"flutter-bond-8ae02","configurations":{"android":"1:1077101979846:android:00afb3c0b4d1b8ae3a0fc7","ios":"1:1077101979846:ios:a2d61d584196a5be3a0fc7","macos":"1:1077101979846:ios:bb43f2ef1264d0e03a0fc7"}},"lib/firebase_options_staging.dart":{"projectId":"flutter-bond-staging-7dd42","configurations":{"android":"1:390157281889:android:bf4d85c3c9a51044ab9820","ios":"1:390157281889:ios:8c87b8875dcdd94aab9820","macos":"1:390157281889:ios:ba7ec93993371072ab9820"}}}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,73 @@ | ||
#!/bin/bash | ||
|
||
capitalize_first_letter() { | ||
local word="$1" | ||
echo "$word" | awk '{print toupper(substr($0,1,1)) tolower(substr($0,2))}' | ||
} | ||
|
||
# Description: This script configures Firebase for different environments using the FlutterFire CLI. | ||
|
||
# VARIABLES TO BE MODIFIED | ||
# Function to configure Firebase | ||
configure_firebase() { | ||
local PROJECT_ID=$1 | ||
local ANDROID_PACKAGE_NAME=$2 | ||
local IOS_BUNDLE_ID=$3 | ||
local MACOS_BUNDLE_ID=$4 | ||
local ENV=$5 | ||
local IOS_BUILD_CONFIG=$6 | ||
local MACOS_BUILD_CONFIG=$7 | ||
local OUT_FILE=$8 | ||
|
||
# Production Environment | ||
PROJECT_ID_PRODUCTION="flutter-bond-87485" # Firebase project ID for production | ||
ANDROID_PACKAGE_NAME_PRODUCTION="ps.app.bond" # Android package name for production | ||
IOS_BUNDLE_ID_PRODUCTION="ps.app.bond" # iOS bundle ID for production | ||
MACOS_BUNDLE_ID_PRODUCTION="ps.app.flutterBond" # macOS bundle ID for production | ||
WEB_APP_ID_PRODUCTION="1:766000556009:web:2165a143cd98adf4d0cd78" # Web app ID for production | ||
if [ -z "$PROJECT_ID" ]; then | ||
echo "No PROJECT_ID provided for ${ENV} environment. Creating a new Firebase project..." | ||
PROJECT_NAME="flutter-bond-${ENV}-$(date +%s)" | ||
firebase projects:create $PROJECT_NAME --display-name "$PROJECT_NAME" | ||
PROJECT_ID=$(firebase projects:list --filter="$PROJECT_NAME" --format="value(projectId)") | ||
echo "Created new Firebase project with ID: $PROJECT_ID" | ||
fi | ||
|
||
# Staging Environment | ||
PROJECT_ID_STAGING="flutter-bond-staging" # Firebase project ID for staging | ||
ANDROID_PACKAGE_NAME_STAGING="ps.app.bond.staging" # Android package name for staging | ||
IOS_BUNDLE_ID_STAGING="ps.app.bond.staging" # iOS bundle ID for staging | ||
MACOS_BUNDLE_ID_STAGING="ps.app.flutterBond.staging" # macOS bundle ID for staging | ||
WEB_APP_ID_STAGING="1:1060161913171:web:68b14b55cce605b655a1a6" # Web app ID for staging | ||
echo "Configuring Firebase for ${ENV} environment with project ID $PROJECT_ID..." | ||
|
||
capitalized_env=$(capitalize_first_letter "$ENV") | ||
|
||
# Production Environment Configuration | ||
flutterfire configure \ | ||
--yes \ | ||
--project=$PROJECT_ID_PRODUCTION \ | ||
--platforms=ios,macos,android,web \ | ||
--android-out=android/app/src/production/google-services.json \ | ||
--android-package-name=$ANDROID_PACKAGE_NAME_PRODUCTION \ | ||
--ios-build-config='Debug-Production' \ | ||
--ios-out=/ios/production/GoogleService-Info.plist \ | ||
--ios-bundle-id=$IOS_BUNDLE_ID_PRODUCTION \ | ||
--macos-build-config='Debug-Production' \ | ||
--macos-out=/macos/production/GoogleService-Info.plist \ | ||
--macos-bundle-id=$MACOS_BUNDLE_ID_PRODUCTION \ | ||
--web-app-id=$WEB_APP_ID_PRODUCTION \ | ||
--out=lib/firebase_options_production.dart | ||
flutterfire configure \ | ||
--yes \ | ||
--project=$PROJECT_ID \ | ||
--platforms=ios,macos,android \ | ||
--android-out=android/app/src/${ENV}/google-services.json \ | ||
--android-package-name=$ANDROID_PACKAGE_NAME \ | ||
--ios-build-config=$IOS_BUILD_CONFIG \ | ||
--ios-out=ios/${capitalized_env}/GoogleService-Info.plist \ | ||
--ios-bundle-id=$IOS_BUNDLE_ID \ | ||
--macos-build-config=$MACOS_BUILD_CONFIG \ | ||
--macos-out=macos/${capitalized_env}/GoogleService-Info.plist \ | ||
--macos-bundle-id=$MACOS_BUNDLE_ID \ | ||
--out=lib/firebase_options_${ENV}.dart | ||
|
||
# Production Environment Release Configuration | ||
flutterfire configure \ | ||
--yes \ | ||
--project=$PROJECT_ID_PRODUCTION \ | ||
--ios-build-config='Release-Production' \ | ||
--ios-out=/ios/production/GoogleService-Info.plist \ | ||
--ios-bundle-id=$IOS_BUNDLE_ID_PRODUCTION \ | ||
--macos-build-config='Release-Production' \ | ||
--macos-out=/macos/production/GoogleService-Info.plist \ | ||
--macos-bundle-id=$MACOS_BUNDLE_ID_PRODUCTION \ | ||
--out=lib/firebase_options_production.dart | ||
if [ $? -ne 0 ]; then | ||
echo "Error configuring Firebase for ${ENV} environment." | ||
exit 1 | ||
else | ||
echo "Successfully configured Firebase for ${ENV} environment." | ||
fi | ||
} | ||
|
||
# Production Environment | ||
PROJECT_ID_PRODUCTION="flutter-bond-8ae02" | ||
ANDROID_PACKAGE_NAME_PRODUCTION="ps.app.bond" | ||
IOS_BUNDLE_ID_PRODUCTION="ps.app.bond" | ||
MACOS_BUNDLE_ID_PRODUCTION="ps.app.flutterBond" | ||
|
||
# Staging Environment | ||
PROJECT_ID_STAGING="flutter-bond-staging-7dd42" | ||
ANDROID_PACKAGE_NAME_STAGING="ps.app.bond.staging" | ||
IOS_BUNDLE_ID_STAGING="ps.app.bond.staging" | ||
MACOS_BUNDLE_ID_STAGING="ps.app.flutterBond.staging" | ||
|
||
# Staging Environment Configuration | ||
flutterfire configure \ | ||
--yes \ | ||
--project=$PROJECT_ID_STAGING \ | ||
--platforms=ios,macos,android,web \ | ||
--android-out=android/app/src/staging/google-services.json \ | ||
--android-package-name=$ANDROID_PACKAGE_NAME_STAGING \ | ||
--ios-build-config='Debug-Staging' \ | ||
--ios-out=/ios/staging/GoogleService-Info.plist \ | ||
--ios-bundle-id=$IOS_BUNDLE_ID_STAGING \ | ||
--macos-build-config='Debug-Staging' \ | ||
--macos-out=/macos/staging/GoogleService-Info.plist \ | ||
--macos-bundle-id=$MACOS_BUNDLE_ID_STAGING \ | ||
--web-app-id=$WEB_APP_ID_STAGING \ | ||
--out=lib/firebase_options_staging.dart | ||
# Configure Production Environment | ||
configure_firebase $PROJECT_ID_PRODUCTION $ANDROID_PACKAGE_NAME_PRODUCTION $IOS_BUNDLE_ID_PRODUCTION $MACOS_BUNDLE_ID_PRODUCTION "production" "Debug-Production" "Debug-Production" "firebase_options_production.dart" | ||
configure_firebase $PROJECT_ID_PRODUCTION $ANDROID_PACKAGE_NAME_PRODUCTION $IOS_BUNDLE_ID_PRODUCTION $MACOS_BUNDLE_ID_PRODUCTION "production" "Release-Production" "Release-Production" "firebase_options_production.dart" | ||
|
||
# Staging Environment Release Configuration | ||
flutterfire configure \ | ||
--yes \ | ||
--project=$PROJECT_ID_STAGING \ | ||
--platforms=ios,macos \ | ||
--ios-build-config='Release-Staging' \ | ||
--ios-out=/ios/staging/GoogleService-Info.plist \ | ||
--ios-bundle-id=$IOS_BUNDLE_ID_STAGING \ | ||
--macos-build-config='Release-Staging' \ | ||
--macos-out=/macos/staging/GoogleService-Info.plist \ | ||
--macos-bundle-id=$MACOS_BUNDLE_ID_STAGING \ | ||
--out=lib/firebase_options_staging.dart | ||
# Configure Staging Environment | ||
configure_firebase $PROJECT_ID_STAGING $ANDROID_PACKAGE_NAME_STAGING $IOS_BUNDLE_ID_STAGING $MACOS_BUNDLE_ID_STAGING "staging" "Debug-Staging" "Debug-Staging" "firebase_options_staging.dart" | ||
configure_firebase $PROJECT_ID_STAGING $ANDROID_PACKAGE_NAME_STAGING $IOS_BUNDLE_ID_STAGING $MACOS_BUNDLE_ID_STAGING "staging" "Release-Staging" "Release-Staging" "firebase_options_staging.dart" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.