Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

mozilla-tw/Firefox-Lite-Remote-Config-Handy-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Firefox Lite Remote Config Handy Tool

This script can 1)retrieve, 2)publish, 3)rollback version 4)list versions of Firebase remote configuration on FirefoxLite Preview or FirefoxLite Production projects.

Prerequisition

  1. Download admin private key from Firefox Nightly and Firefox Prod Firebase settings , refer get access token

  2. After download Nightly key, please place in the same folder and reanme it to "service-account-nightly.json".

  3. After download Production key, please place in the same folder and reanme it to "service-account-prod.json"

Alternative ways

For step 2 & 3 ,alternatively, we can also get keys through CLI,

  1. Gcloud login
gcloud auth login
  1. Set the current project
gcloud config set project [PROJECT_ID]
  1. List available service accounts to copy [SERVICE_ACCOUNT_EMAIL]
gcloud iam service-accounts list
  1. Create service account key
gcloud iam service-accounts keys create [service-account-nightly.json|service-account-prod.json] --iam-account [SERVICE_ACCOUNT_EMAIL]

Installation

Use the package manager pip3 to install Remote Config Script.

pip3 install -r requirements.txt

Usage

Please use one of the following commands:

  1. Download remote config file and get [LATEST_ETAG]
python3 remoteConfig.py --action=get --env=[prod|nightly]
  1. Publish local remote config file to Firebase by feeding [LATEST_ETAG]
python3 remoteConfig.py --action=publish --env=[prod|nightly] --etag=[LATEST_ETAG]
  1. Print the last 5 Remote Config version's metadata
python3 remoteConfig.py --action=versions --env=[prod|nightly]
  1. Roll back to an available version of Firebase Remote Config
python3 remoteConfig.py --action=rollback --env=[prod|nightly]  --version=[TEMPLATE_VERSION_NUMBER]

Authors

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.