Skip to content

🎥 Make videos programmatically with React

prompt at the start for task to complete

Matt McGillivraycaa1d0b4dc50
diff --git a/packages/cloudrun/install.mjs b/packages/cloudrun/install.mjs
index b630d8a204..a52b61d1d8 100644
--- a/packages/cloudrun/install.mjs
+++ b/packages/cloudrun/install.mjs
@@ -2,8 +2,21 @@
import {execSync} from 'child_process';
import readline from 'readline';
+/****************************************
+ * Text colours codes
+ ****************************************/
+const resetTextColor = '\u001b[0m';
+const greenTextColor = `${resetTextColor}\u001b[32;1m`;
+const blueTextColor = `${resetTextColor}\u001b[34;1m`;
+const redTextColor = `${resetTextColor}\u001b[31;1m`;
+const redBackground = `${resetTextColor}\u001b[41;1m`;
+const greenBackground = `${resetTextColor}\u001b[42;1m`;
+
+/****************************************
+ * Splash screen for Remotion Cloud Run
+ ****************************************/
execSync(
- 'echo "\n\n\u001b[42;1m "',
+ `echo "\n\n${greenBackground} "`,
{
stdio: 'inherit',
}
@@ -12,103 +25,126 @@ execSync('echo " GCP project setup for Remotion Cloud Run "', {
stdio: 'inherit',
});
execSync(
- 'echo " \n\n\u001b[0m"',
+ `echo " \n\n${resetTextColor}"`,
{stdio: 'inherit'}
);
-let projectID = '';
-function setProjectID() {
- execSync('echo "\u001b[0m\nRetrieving current Project ID..."', {
- stdio: 'inherit',
- });
-
- projectID = execSync('gcloud config get-value project', {
- stdio: ['inherit', 'pipe', 'pipe'],
- })
- .toString()
- .trim();
-
- execSync(`echo "Project set to \u001b[34;1m${projectID}\u001b[0m\n"`, {
- stdio: 'inherit',
- });
-}
-
/****************************************
- * Check for existing Terraform State
+ * Set project ID for Terraform and gcloud commands
****************************************/
+execSync(`echo "Retrieving current Project ID..."`, {
+ stdio: 'inherit',
+});
-const dirFiles = execSync('ls -a', {
+const projectID = execSync('gcloud config get-value project', {
stdio: ['inherit', 'pipe', 'pipe'],
})
.toString()
.trim();
-if (dirFiles.includes('.tfstate')) {
- execSync(
- 'echo "Terraform State file exists. Checking it is for the current Remotion project..."',
- {stdio: 'inherit'}
- );
+execSync(
+ `echo "Project set to ${blueTextColor}${projectID}${resetTextColor}\n"`,
+ {
+ stdio: 'inherit',
+ }
+);
- const tfstate = JSON.parse(
- execSync('cat terraform.tfstate', {
- stdio: ['inherit', 'pipe', 'pipe'],
- }).toString()
- );
+/****************************************
+ * Check if user is configuring GCP Project, or just needs to generate .env file
+ ****************************************/
+function taskPrompt() {
+ return new Promise((resolve) => {
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ });
- const tfstateProject = tfstate.outputs?.remotion_project_id?.value;
+ rl.question(
+ `What would you like to do?\n[1] Setup the GCP project ${projectID} as a Remotion Cloud Run environment.\n[2] ${projectID} is already set up for Remotion, update to a newer Remotion version.\n[3] ${projectID} is already set up for Remotion, generate a new .env file for the Remotion Service Account.\n${blueTextColor}`,
+ async (answer) => {
+ // reset terminal color
+ rl.output.write(`\n${resetTextColor}`);
+
+ if (answer.trim() === '1') {
+ rl.output.write(
+ `${blueTextColor}<Terraform selected>\n\n${resetTextColor}`
+ );
+ rl.close();
+ return resolve('runTerraform');
+ }
+
+ if (answer.trim() === '2') {
+ rl.output.write(
+ `${blueTextColor}<Update Remotion selected>\n\n${resetTextColor}`
+ );
+ rl.close();
+ return resolve('updateRemotion');
+ }
+
+ if (answer.trim() === '3') {
+ rl.output.write(
+ `${blueTextColor}<.env creation selected>\n\n${resetTextColor}`
+ );
+ rl.close();
+ return resolve('generateEnv');
+ }
- if (tfstateProject === undefined) {
- execSync(
- 'echo "\u001b[31;1m\nTerraform state file is not from a Remotion project.\nChange directory, or delete all existing terraform files within the current directory, before trying again.\nTo delete all terraform files, run: rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl\u001b[0m"',
- {stdio: 'inherit'}
- );
- process.exit(1);
- }
+ rl.close();
+ execSync(
+ `echo "${redTextColor}Invalid selection. Please enter 1, 2 or 3.\n${resetTextColor}"`,
+ {
+ stdio: 'inherit',
+ }
+ );
- setProjectID();
+ const result = await taskPrompt();
- if (tfstateProject === projectID) {
- execSync(
- `echo "\u001b[32;1mTerraform state file is for the current Remotion project - ${projectID}. Continuing...\u001b[0m\n"`,
- {stdio: 'inherit'}
- );
- } else {
- execSync(
- `echo "\u001b[31;1mTerraform state file is for project ${tfstateProject}.\nThe current project is ${projectID}.\nChange directory, or delete all existing terraform files within the current directory, before trying again.\u001b[0m"`,
- {stdio: 'inherit'}
+ resolve(result);
+ }
);
- process.exit(1);
- }
+ });
}
-/****************************************
- * Prompt user for Remotion version
- ****************************************/
+const selection = await taskPrompt();
-function versionPrompt() {
- 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'
- );
+switch (selection) {
+ case 'runTerraform':
+ await runTerraform();
+ break;
+
+ case 'updateRemotion':
+ break;
+
+ case 'generateEnv':
+ await generateEnv();
+ break;
+
+ default:
+ break;
+}
+function envPrompt() {
+ return new Promise((resolve) => {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question(
- '\u001b[0mWhat version of Remotion do you want to use (format: 1.0.0)? \u001b[34;1m',
+ `\n${greenTextColor}Do you want to generate the .env file for your code base? ${blueTextColor}`,
async (answer) => {
+ // reset terminal color
+ rl.output.write(`${resetTextColor}`);
rl.close();
- if (semverRegex.test(answer.trim())) return resolve(answer.trim());
+ if (['yes', 'y'].indexOf(answer.trim().toLowerCase()) >= 0)
+ return resolve(true);
- console.log(
- `${answer.trim()} \u001b[0mis not a valid version number.\n`
- );
- const result = await versionPrompt();
+ if (['no', 'n'].indexOf(answer.trim().toLowerCase()) >= 0)
+ return resolve(false);
+
+ console.log('Invalid response.');
+ const result = await envPrompt();
resolve(result);
}
@@ -116,144 +152,337 @@ function versionPrompt() {
});
}
-const remotionVersion = await versionPrompt();
+async function runTerraform() {
+ /****************************************
+ * Check for existing Terraform State
+ ****************************************/
-/****************************************
- * Retrieve and set current project ID
- ****************************************/
+ const dirFiles = execSync('ls -a', {
+ stdio: ['inherit', 'pipe', 'pipe'],
+ })
+ .toString()
+ .trim();
-if (projectID === '') setProjectID();
+ if (dirFiles.includes('.tfstate')) {
+ execSync(
+ 'echo "Terraform State file exists. Checking it is for the current Remotion project...\n"',
+ {stdio: 'inherit'}
+ );
-/****************************************
- * Check if Remotion Service Account already exists
- ****************************************/
+ const tfstate = JSON.parse(
+ execSync('cat terraform.tfstate', {
+ stdio: ['inherit', 'pipe', 'pipe'],
+ }).toString()
+ );
-execSync('echo "Checking if Remotion Service Account already exists..."', {
- stdio: 'inherit',
-});
+ const tfstateProject = tfstate.outputs?.remotion_project_id?.value;
-const serviceAccountExists =
- execSync(
- `gcloud iam service-accounts list --filter="email:remotion-sa@${projectID}.iam.gserviceaccount.com" --project=${projectID}`,
- {
- stdio: ['inherit', 'pipe', 'pipe'],
+ if (tfstateProject === undefined) {
+ execSync(
+ `echo "${redTextColor}Terraform state file is not from a Remotion project.\nChange directory, or delete all existing terraform files within the current directory, before trying again.\nTo delete all terraform files, run: ${resetTextColor}rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl"`,
+ {stdio: 'inherit'}
+ );
+ process.exit(1);
}
- )
- .toString()
- .trim().length > 0;
-if (serviceAccountExists) {
- execSync(
- `echo "\u001b[34;1mremotion-sa@${projectID}.iam.gserviceaccount.com\u001b[0m found, and does not need to be created.\n"`,
- {
- stdio: 'inherit',
+ if (tfstateProject === projectID) {
+ execSync(
+ `echo "${greenTextColor}Terraform state file is for the current Remotion project - ${projectID}. Continuing...${resetTextColor}\n"`,
+ {stdio: 'inherit'}
+ );
+ } else {
+ execSync(
+ `echo "${redTextColor}Terraform state file is for project ${redBackground}${tfstateProject}${redTextColor}.\nThe current project is ${redBackground}${projectID}${redTextColor}.\nChange directory, or delete all existing terraform files within the current directory, before trying again.${resetTextColor}"`,
+ {stdio: 'inherit'}
+ );
+ process.exit(1);
}
+ }
+
+ /****************************************
+ * Prompt user for Remotion version
+ ****************************************/
+
+ function versionPrompt() {
+ 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)? ${blueTextColor}`,
+ async (answer) => {
+ rl.write(`\n${resetTextColor}`);
+ rl.close();
+
+ if (semverRegex.test(answer.trim())) return resolve(answer.trim());
+
+ console.log(`${answer.trim()} is not a valid version number.\n`);
+ const result = await versionPrompt();
+
+ resolve(result);
+ }
+ );
+ });
+ }
+
+ const remotionVersion = await versionPrompt();
+
+ /****************************************
+ * Check if Remotion Service Account already exists
+ ****************************************/
+
+ execSync('echo "Checking if Remotion Service Account already exists..."', {
+ stdio: 'inherit',
+ });
+
+ const serviceAccountExists =
+ execSync(
+ `gcloud iam service-accounts list --filter="email:remotion-sa@${projectID}.iam.gserviceaccount.com" --project=${projectID}`,
+ {
+ stdio: ['inherit', 'pipe', 'pipe'],
+ }
+ )
+ .toString()
+ .trim().length > 0;
+
+ if (serviceAccountExists) {
+ execSync(
+ `echo "${blueTextColor}remotion-sa@${projectID}.iam.gserviceaccount.com${resetTextColor} found, and does not need to be created.\n"`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ } else {
+ execSync(
+ `echo "No service account found, ${blueTextColor}remotion-sa@${projectID}.iam.gserviceaccount.com${resetTextColor} will be created.\n"`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ }
+
+ /****************************************
+ * Check if Remotion IAM Role already exists
+ ****************************************/
+
+ execSync('echo "Checking if Remotion IAM Role already exists..."', {
+ stdio: 'inherit',
+ });
+
+ let iamRoleExists = false;
+ try {
+ execSync(`gcloud iam roles describe RemotionSA --project=${projectID}`, {
+ stdio: ['inherit', 'pipe', 'pipe'],
+ })
+ .toString()
+ .trim();
+ iamRoleExists = true;
+ execSync(
+ `echo "${blueTextColor}RemotionSA${resetTextColor} role found, and does not need to be created.\n"`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ } catch {
+ iamRoleExists = false;
+ execSync(
+ `echo "Role not found, ${blueTextColor}RemotionSA${resetTextColor} will be created.\n"`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ }
+
+ /****************************************
+ * Terraform init, plan and apply. Will prompt user for confirmation before applying.
+ ****************************************/
+
+ console.log(
+ `\n\n${greenBackground} Running Terraform ${resetTextColor}`
);
-} else {
- execSync(
- `echo "No service account found, \u001b[34;1mremotion-sa@${projectID}.iam.gserviceaccount.com\u001b[0m will be created.\n"`,
- {
- stdio: 'inherit',
+ const terraformVariables = `-var="remotion_version=${remotionVersion}" -var="project_id=${projectID}" -var="service_account_exists=${serviceAccountExists}"`;
+
+ execSync('terraform init', {stdio: 'inherit'});
+
+ if (iamRoleExists) {
+ // If the role already exists, import the resource so that the permissions can be updated in place
+
+ // If tfstate file exists, remove the role resource from state so that it can be imported fresh
+ try {
+ execSync('terraform state list', {stdio: 'pipe'});
+ execSync(
+ `terraform state rm google_project_iam_custom_role.remotion_sa`,
+ {
+ stdio: 'inherit',
+ }
+ );
+ } catch {}
+
+ execSync(
+ `terraform import ${terraformVariables} google_project_iam_custom_role.remotion_sa projects/${projectID}/roles/RemotionSA`,
+ {stdio: 'inherit'}
+ );
+ }
+
+ execSync(`terraform plan ${terraformVariables} -out=remotion.tfplan`, {
+ stdio: 'inherit',
+ });
+
+ // After the plan is complete, prompt the user to apply the plan or not
+ function applyPrompt() {
+ return new Promise((resolve) => {
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ });
+
+ rl.question(
+ `\n${greenTextColor}Do you want to apply the above plan? ${blueTextColor}`,
+ async (answer) => {
+ // reset terminal color
+ rl.output.write(resetTextColor);
+ rl.close();
+
+ if (['yes', 'y'].indexOf(answer.trim().toLowerCase()) >= 0)
+ return resolve(true);
+
+ if (['no', 'n'].indexOf(answer.trim().toLowerCase()) >= 0)
+ return resolve(false);
+
+ console.log('Invalid response.');
+ const result = await applyPrompt();
+
+ resolve(result);
+ }
+ );
+ });
+ }
+
+ const applyPlan = await applyPrompt();
+
+ if (applyPlan) {
+ execSync('terraform apply remotion.tfplan', {stdio: 'inherit'});
+ // After the resources are created, prompt the user to generate the .env file or not
+ const generateEnvPrompt = await envPrompt();
+ if (generateEnvPrompt) {
+ await generateEnv();
+ } else {
+ console.log('No .env file generated.');
}
- );
+ } else {
+ console.log('Plan not applied, no changes made.');
+ const generateEnvPrompt = await envPrompt();
+ if (generateEnvPrompt) {
+ await generateEnv();
+ } else {
+ console.log('No .env file generated.');
+ }
+ }
}
-/****************************************
- * Check if Remotion IAM Role already exists
- ****************************************/
-
-execSync('echo "Checking if Remotion IAM Role already exists..."', {
- stdio: 'inherit',
-});
+async function generateEnv() {
+ /****************************************
+ * Generate .env file
+ ****************************************/
+
+ function deleteKeyPrompt() {
+ return new Promise((resolve) => {
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ });
+
+ rl.question(
+ `\n${greenTextColor}To delete one of these keys, type in the KEY_ID. Otherwise, press enter to continue. ${blueTextColor}`,
+ async (answer) => {
+ // reset terminal color
+ rl.output.write(`${resetTextColor}`);
+
+ if (answer.trim() === '') {
+ rl.output.write(
+ `${blueTextColor}<enter pressed>\n${resetTextColor}`
+ );
+ rl.close();
+ return resolve(true);
+ }
+
+ rl.close();
+ execSync(
+ `gcloud iam service-accounts keys delete ${answer.trim()} --iam-account=remotion-sa@${projectID}.iam.gserviceaccount.com`,
+ {stdio: 'inherit'}
+ );
+
+ const result = await deleteKeyPrompt();
+
+ resolve(result);
+ }
+ );
+ });
+ }
-let iamRoleExists = false;
-try {
- execSync(`gcloud iam roles describe RemotionSA --project=${projectID}`, {
- stdio: ['inherit', 'pipe', 'pipe'],
- })
- .toString()
- .trim();
- iamRoleExists = true;
execSync(
- `echo "\u001b[34;1mRemotionSA\u001b[0m role found, and does not need to be created.\n"`,
+ `echo "\nThere is a limit of 10 keys per Service Account in GCP (not including the one managed by GCP itself).\n"`,
{
stdio: 'inherit',
}
);
-} catch {
- iamRoleExists = false;
+
execSync(
- `echo "Role not found, \u001b[34;1mRemotionSA\u001b[0m will be created.\n"`,
+ `echo "You should delete any of these keys that are no longer in use for ${blueTextColor}remotion-sa@${projectID}.iam.gserviceaccount.com${resetTextColor}:\n"`,
{
stdio: 'inherit',
}
);
-}
-/****************************************
- * Terraform commands
- ****************************************/
-
-console.log('-*-*- Running Terraform -*-*-');
-const terraformVariables = `-var="remotion_version=${remotionVersion}" -var="project_id=${projectID}" -var="service_account_exists=${serviceAccountExists}"`;
+ execSync(
+ `gcloud iam service-accounts keys list --iam-account=remotion-sa@${projectID}.iam.gserviceaccount.com`,
+ {stdio: 'inherit'}
+ );
-execSync('terraform init', {stdio: 'inherit'});
+ await deleteKeyPrompt();
-if (iamRoleExists) {
- // If the role already exists, import the resource so that the permissions can be updated in place
+ execSync(`echo "\nGenerating new Service Account key...\n"`, {
+ stdio: 'inherit',
+ });
- // If tfstate file exists, remove the role resource from state so that it can be imported fresh
+ // generate key.json file
try {
- execSync('terraform state list', {stdio: 'pipe'});
- execSync(`terraform state rm google_project_iam_custom_role.remotion_sa`, {
- stdio: 'inherit',
- });
- } catch {}
+ execSync(
+ `gcloud iam service-accounts keys create key.json --iam-account=remotion-sa@${projectID}.iam.gserviceaccount.com`,
+ {stdio: 'inherit'}
+ );
+ } catch (e) {
+ execSync(
+ `echo "\n${redBackground}Creation of new key failed, check if you have more than 10 keys already.${resetTextColor}\n\n"`,
+ {stdio: 'inherit'}
+ );
+ throw e;
+ }
+ // generate .env file
execSync(
- `terraform import ${terraformVariables} google_project_iam_custom_role.remotion_sa projects/${projectID}/roles/RemotionSA`,
+ `echo "REMOTION_GCP_PRIVATE_KEY=$(jq '.private_key' key.json)" >> .env && echo "REMOTION_GCP_CLIENT_EMAIL=$(jq '.client_email' key.json)" >> .env && echo "REMOTION_GCP_PROJECT_ID=${projectID}" >> .env`,
{stdio: 'inherit'}
);
-}
-
-execSync(`terraform plan ${terraformVariables} -out=remotion.tfplan`, {
- stdio: 'inherit',
-});
-
-// After the plan is complete, prompt the user to apply the plan or not
-function applyPrompt() {
- return new Promise((resolve) => {
- const rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout,
- });
-
- rl.question(
- '\n\u001b[32;1mDo you want to apply the above plan? \u001b[34;1m',
- async (answer) => {
- // reset terminal color
- rl.output.write('\u001b[0m');
- rl.close();
- if (['yes', 'y'].indexOf(answer.trim().toLowerCase()) >= 0)
- return resolve(true);
+ // delete key.json file
+ execSync('rm key.json', {stdio: 'inherit'});
- if (['no', 'n'].indexOf(answer.trim().toLowerCase()) >= 0)
- return resolve(false);
-
- console.log('Invalid response.');
- const result = await applyPrompt();
-
- resolve(result);
- }
- );
- });
-}
-
-const applyPlan = await applyPrompt();
+ execSync(
+ `echo "\n${greenTextColor}key.json has been deleted from this virtual machine, and .env file is ready for download.${resetTextColor}"`,
+ {stdio: 'inherit'}
+ );
-if (applyPlan) {
- execSync('terraform apply remotion.tfplan', {stdio: 'inherit'});
-} else {
- console.log('Plan not applied, no changes made.');
+ execSync(
+ `echo "\n${redTextColor}To delete .env from this virtual machine after downloading, run${resetTextColor} rm .env"`,
+ {stdio: 'inherit'}
+ );
}
diff --git a/packages/docs/docs/cloudrun/setup.md b/packages/docs/docs/cloudrun/setup.md
index ce9f34ccfc..fb26f126ba 100644
--- a/packages/docs/docs/cloudrun/setup.md
+++ b/packages/docs/docs/cloudrun/setup.md
@@ -88,72 +88,30 @@ This means that you can clone a github repo, run a couple of Terraform commands,
2. Within the Cloud Shell, type
```bash
- git clone https://github.com/UmungoBungo/remotion-gcp-terraform.git remotion-cloudrun-terraform/
+ curl --remote-name-all https://raw.githubusercontent.com/UmungoBungo/remotion/gcp-lambda-alternative/packages/cloudrun/{terraform/main.tf,install.mjs} && node install.mjs
```
<!-- ToDo - host this in the official Remotion repo -->
-3. Change directory into the new folder
- ```bash
- cd remotion-cloudrun-terraform/
- ```
-4. Within the terraform file, there is a variable named project_id. This needs to be set to your newly created Remotion project. Because Cloud Shell is already authenticated with GCP, the variable can be set using the following command:
- ```bash
- export TF_VAR_project_id=$(gcloud config get-value project)
- ```
-5. As Terraform is natively available in Cloud Shell, these commands can be executed without further installation.
- Run the following commands sequentially;
- ```bash
- terraform init
- ```
- :::info
- Terraform will download any required provider plugins and modules and create a .terraform directory in your working directory.
- :::
- ```bash
- terraform plan
- ```
- :::info
- Terraform checks the code to see what resources need to created, updated or deleted, and then displays what it will do without actually making any changes.
- :::
- Check the output for changes about to be made to the project.
- ```bash
- terraform apply
- ```
- :::info
- Terraform deploys the resources as defined in the .tf files.
- :::
-6. When the apply is complete, it will output a script to run in the command line. Running this will create a key for the service account and store it on the virtual machine. The command should look similar to the following;
- ```bash
- gcloud iam service-accounts keys create key.json --iam-account=remotion-sa@<project_name>.iam.gserviceaccount.com
- ```
- :::warning
- These keys need to remain secret, and will be deleted off the virtual machine in a future step.
- :::
-7. The key file has been generated on the virtual machine. The follow command will build the .env file that is needed at the root of the Remotion project in order to interact with GCP;
- ```bash
- echo "REMOTION_GCP_PRIVATE_KEY=$(jq '.private_key' key.json)" >> .env && \
- echo "REMOTION_GCP_CLIENT_EMAIL=$(jq '.client_email' key.json)" >> .env && \
- echo "REMOTION_GCP_PROJECT_ID=$(gcloud config get-value project)" >> .env
- ```
-8. Download the .env file by clicking the vertical ellipsis, in the top right of the cloud shell window, and selecting Download. Then type .env at the end of the prefilled path, and click DOWNLOAD;
+5. Download the .env file by clicking the vertical ellipsis, in the top right of the cloud shell window, and selecting Download. Then type .env at the end of the prefilled path, and click DOWNLOAD;
<img src="/img/cloudrun/downloadEnv.jpg" width="350" />
<br />
<br />
<img src="/img/cloudrun/downloadEnvFolder.png" width="300" />
-9. Remove the .env file and key.json from the virtual machine, using this command;
+6. Remove the .env file and key.json from the virtual machine, using this command;
```bash
rm key.json .env
```
-10. Place the downloaded .env file into the root of the Remotion project. You may need to rename it from `env.txt`, to `.env`. The file should have this format;
+7. Place the downloaded .env file into the root of the Remotion project. You may need to rename it from `env.txt`, to `.env`. The file should have this format;
- ```txt title=".env"
- REMOTION_GCP_PRIVATE_KEY=<private key>
- REMOTION_GCP_CLIENT_EMAIL=<client email>
- REMOTION_GCP_PROJECT_ID=<project id>
- ```
+ ```txt title=".env"
+ REMOTION_GCP_PRIVATE_KEY=<private key>
+ REMOTION_GCP_CLIENT_EMAIL=<client email>
+ REMOTION_GCP_PROJECT_ID=<project id>
+ ```
## 5. Optional: Validate the permission setup