This script can 1)retrieve, 2)publish, 3)rollback version 4)list versions of Firebase remote configuration on FirefoxLite Preview or FirefoxLite Production projects.
-
Download admin private key from Firefox Nightly and Firefox Prod Firebase settings , refer get access token
-
After download Nightly key, please place in the same folder and reanme it to "service-account-nightly.json".
-
After download Production key, please place in the same folder and reanme it to "service-account-prod.json"
For step 2 & 3 ,alternatively, we can also get keys through CLI,
- Gcloud login
gcloud auth login
- Set the current project
gcloud config set project [PROJECT_ID]
- List available service accounts to copy [SERVICE_ACCOUNT_EMAIL]
gcloud iam service-accounts list
- Create service account key
gcloud iam service-accounts keys create [service-account-nightly.json|service-account-prod.json] --iam-account [SERVICE_ACCOUNT_EMAIL]
Use the package manager pip3 to install Remote Config Script.
pip3 install -r requirements.txt
Please use one of the following commands:
- Download remote config file and get [LATEST_ETAG]
python3 remoteConfig.py --action=get --env=[prod|nightly]
- Publish local remote config file to Firebase by feeding [LATEST_ETAG]
python3 remoteConfig.py --action=publish --env=[prod|nightly] --etag=[LATEST_ETAG]
- Print the last 5 Remote Config version's metadata
python3 remoteConfig.py --action=versions --env=[prod|nightly]
- Roll back to an available version of Firebase Remote Config
python3 remoteConfig.py --action=rollback --env=[prod|nightly] --version=[TEMPLATE_VERSION_NUMBER]
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.