🎥 Make videos programmatically with React
no need to ask for remotion version
Jonny Burger1ab1b8b3456d
diff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/remotionVersionPrompt.mts b/packages/cloudrun/gcpInstaller/installerScripts/components/remotionVersionPrompt.mtsdeleted file mode 100644index 05daab4d22..0000000000--- a/packages/cloudrun/gcpInstaller/installerScripts/components/remotionVersionPrompt.mts+++ /dev/null@@ -1,58 +0,0 @@-import {execSync} from 'child_process';-import readline from 'readline';-import {colorCode} from './colorCodes.mjs';--export function remotionVersionPrompt() {- return new Promise((resolve) => {- // regex to ensure remotionVersion is in semver format- const semverRegex = new RegExp(- /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,- 'i'- );-- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout,- });-- rl.question(- `What version of Remotion do you want to use (format: 1.0.0)? ${colorCode.blueText}`,- async (answer) => {- rl.write(`\n${colorCode.resetText}`);- rl.close();-- let fileError = false;- if (semverRegex.test(answer.trim())) {- try {- execSync(`gcloud storage ls gs://remotion-sa/sa-permissions.json`);- return resolve(answer.trim());- } catch {- fileError = true;- }- }-- if (fileError) {- console.log(- `${- colorCode.redText- }Cannot find permissions file that matches version ${answer.trim()}.\n${- colorCode.resetText- }`- );- } else {- console.log(- `${- colorCode.redText- }${answer.trim()} is not a valid semver version number.\n${- colorCode.resetText- }`- );- }-- const result = await remotionVersionPrompt();-- resolve(result);- }- );- });-}diff --git a/packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mts b/packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mtsindex 9a56eb5fdd..0fc201da8a 100644--- a/packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mts+++ b/packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mts@@ -3,7 +3,6 @@ import {execSync} from 'child_process';import {checkTerraformStateFile} from '../components/checkTerraformStateFile.mjs';import {colorCode} from '../components/colorCodes.mjs';import {generateEnvPrompt} from '../components/generateEnvPrompt.mjs';-import {remotionVersionPrompt} from '../components/remotionVersionPrompt.mjs';import {terraformApplyPrompt} from '../components/terraformApplyPrompt.mjs';import {tfSuccessScreen} from '../components/tfSuccessScreen.mjs';// Tasks@@ -11,11 +10,6 @@ import {generateEnv} from './generateEnv.mjs';export async function setupGcpProject(projectID: string) {checkTerraformStateFile(projectID);- /****************************************- * Prompt user for Remotion version- ****************************************/- // TODO: Should take version from Remotion- const remotionVersion = await remotionVersionPrompt();/***************************************** Check if Remotion Service Account already exists@@ -198,7 +192,7 @@ export async function setupGcpProject(projectID: string) {console.log(`\n\n${colorCode.greenBackground} Running Terraform ${colorCode.resetText}`);- const terraformVariables = `-var="remotion_version=${remotionVersion}" -var="project_id=${projectID}"`;+ const terraformVariables = `-var="project_id=${projectID}"`;execSync('terraform init', {stdio: 'inherit'});diff --git a/packages/cloudrun/gcpInstaller/main.tf b/packages/cloudrun/gcpInstaller/main.tfindex db0c3acaa0..a6b863277d 100644--- a/packages/cloudrun/gcpInstaller/main.tf+++ b/packages/cloudrun/gcpInstaller/main.tf@@ -14,10 +14,6 @@ variable "project_id" {description = "The ID of the project in which the resources will be created."}-variable "remotion_version" {- type = string- description = "The version of Remotion being deployed."-}provider "google" {@@ -48,7 +44,6 @@ resource "google_project_iam_custom_role" "remotion_sa" {resource "google_service_account" "remotion_sa" {account_id = "remotion-sa"display_name = "Remotion Service Account"- description = var.remotion_version}# Bind the IAM role to the service accountdiff --git a/packages/cloudrun/terraform/main.tf b/packages/cloudrun/terraform/main.tfindex fd1e7cf57d..028e575952 100644--- a/packages/cloudrun/terraform/main.tf+++ b/packages/cloudrun/terraform/main.tf@@ -14,10 +14,6 @@ variable "project_id" {description = "The ID of the project in which the resources will be created."}-variable "remotion_version" {- type = string- description = "The version of Remotion being deployed."-}variable "service_account_exists" {type = bool@@ -54,7 +50,6 @@ resource "google_service_account" "remotion_sa" {count = var.service_account_exists ? 0 : 1 // if the service account already exists, don't create itaccount_id = "remotion-sa"display_name = "Remotion Service Account"- description = var.remotion_version}# Bind the IAM role to the service account