We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Plugins to GCP
The text was updated successfully, but these errors were encountered:
from urllib.parse import urlparse from google.cloud import firestore db = firestore.Client() public_plugins = db.collection('plugins_data').stream() plugins = [doc.to_dict() for doc in public_plugins] def get_new_url(from_url: str): url = urlparse(from_url) if url.hostname == 'based-hardware--plugins-api.modal.run': new_url = 'https://plugins-hhibjajaja-uc.a.run.app' + url.path return new_url return None # https://based-hardware--plugins-api.modal.run/setup-zapier for plugin in plugins: need_update = False # auth steps for aidx, auth_step in enumerate(plugin.get('external_integration', {}).get('auth_steps', [])): new_url = get_new_url(auth_step['url']) if new_url: plugin['external_integration']['auth_steps'][aidx]['url'] = new_url need_update = True # setup_completed_url if 'setup_completed_url' in plugin.get('external_integration', {}): new_url = get_new_url(plugin['external_integration']['setup_completed_url']) if new_url: plugin['external_integration']['setup_completed_url'] = new_url need_update = True # webhook_url if 'webhook_url' in plugin.get('external_integration', {}): new_url = get_new_url(plugin['external_integration']['webhook_url']) if new_url: plugin['external_integration']['webhook_url'] = new_url need_update = True if need_update and plugin['id'] not in ['notion-crm', 'zapier']: print(f"update {plugin['id']}") print(plugin) app_ref = db.collection('plugins_data').document(plugin['id']) app_ref.update(plugin) print(f"done")
Sorry, something went wrong.
thainguyensunya
No branches or pull requests
Migrate Plugins to GCP
deploy steps
The text was updated successfully, but these errors were encountered: