Skip to content

🎥 Make videos programmatically with React

add check that billing is enabled

Matt McGillivray01ad4aade7a1
diff --git a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar
index cd93c5d334..915751d381 100644
Binary files a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar and b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar differ
diff --git a/packages/cloudrun/src/gcpInstaller/install.mts b/packages/cloudrun/src/gcpInstaller/install.mts
index 052025918c..cae2531e69 100644
--- a/packages/cloudrun/src/gcpInstaller/install.mts
+++ b/packages/cloudrun/src/gcpInstaller/install.mts
@@ -35,6 +35,36 @@ const start = async () => {
}
);
+ /****************************************
+ * Ensure billing is setup for project
+ ****************************************/
+ execSync(`echo "Checking that billing is enabled..."`, {
+ stdio: 'inherit',
+ });
+
+ const billingEnabledString = execSync(
+ `gcloud beta billing projects describe ${projectID} --format=json | jq .billingEnabled`,
+ {
+ stdio: ['inherit', 'pipe', 'pipe'],
+ }
+ )
+ .toString()
+ .trim();
+
+ if (billingEnabledString === 'false') {
+ execSync(
+ `echo "${colorCode.redText}Billing is not enabled for this project. Please enable billing at https://console.cloud.google.com/billing and try again.${colorCode.resetText}"`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ process.exit(1);
+ } else {
+ execSync(`echo "Billing is enabled for this ${projectID}"`, {
+ stdio: 'inherit',
+ });
+ }
+
/****************************************
* Check task the user is trying to complete
****************************************/