Skip to content

🎥 Make videos programmatically with React

added tarInstaller to build command cloudrun

Matt McGillivray7f42f8c42096
diff --git a/packages/cloudrun/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/gcpInstaller/gcpInstaller.tar
new file mode 100644
index 0000000000..2858943194
Binary files /dev/null and b/packages/cloudrun/gcpInstaller/gcpInstaller.tar differ
diff --git a/packages/cloudrun/gcpInstaller/install.mjs b/packages/cloudrun/gcpInstaller/install.mjs
index 19f77e2705..20ec386001 100644
--- a/packages/cloudrun/gcpInstaller/install.mjs
+++ b/packages/cloudrun/gcpInstaller/install.mjs
@@ -1,12 +1,12 @@
-import { execSync } from "child_process";
+import {execSync} from 'child_process';
// Components
-import { colorCode } from "./components/colorCodes.mjs";
-import { cloudRunSplashScreen } from "./components/splashScreen.mjs";
-import { taskPrompt } from "./components/taskPrompt.mjs";
+import {colorCode} from './components/colorCodes.mjs';
+import {cloudRunSplashScreen} from './components/splashScreen.mjs';
+import {taskPrompt} from './components/taskPrompt.mjs';
// Tasks
-import { generateEnv } from "./tasks/generateEnv.mjs";
-import { updateRemotion } from "./tasks/updateRemotion.mjs";
-import { setupGcpProject } from "./tasks/setupGcpProject.mjs";
+import {generateEnv} from './tasks/generateEnv.mjs';
+import {setupGcpProject} from './tasks/setupGcpProject.mjs';
+import {updateRemotion} from './tasks/updateRemotion.mjs';
/****************************************
* Splash screen for Remotion Cloud Run
@@ -17,20 +17,20 @@ cloudRunSplashScreen();
* Set project ID for Terraform and gcloud commands
****************************************/
execSync(`echo "Retrieving current Project ID..."`, {
- stdio: "inherit",
+ stdio: 'inherit',
});
-const projectID = execSync("gcloud config get-value project", {
- stdio: ["inherit", "pipe", "pipe"],
+const projectID = execSync('gcloud config get-value project', {
+ stdio: ['inherit', 'pipe', 'pipe'],
})
- .toString()
- .trim();
+ .toString()
+ .trim();
execSync(
- `echo "Project set to ${colorCode.blueText}${projectID}${colorCode.resetText}\n"`,
- {
- stdio: "inherit",
- }
+ `echo "Project set to ${colorCode.blueText}${projectID}${colorCode.resetText}\n"`,
+ {
+ stdio: 'inherit',
+ }
);
/****************************************
@@ -39,18 +39,18 @@ execSync(
const selection = await taskPrompt(projectID);
switch (selection) {
- case "runTerraform":
- await setupGcpProject(projectID);
- break;
+ case 'runTerraform':
+ await setupGcpProject(projectID);
+ break;
- case "updateRemotion":
- await updateRemotion(projectID);
- break;
+ case 'updateRemotion':
+ await updateRemotion(projectID);
+ break;
- case "generateEnv":
- await generateEnv(projectID);
- break;
+ case 'generateEnv':
+ await generateEnv(projectID);
+ break;
- default:
- break;
+ default:
+ break;
}
diff --git a/packages/cloudrun/gcpInstaller/installer.tar b/packages/cloudrun/gcpInstaller/installer.tar
deleted file mode 100644
index 8ba71e60af..0000000000
Binary files a/packages/cloudrun/gcpInstaller/installer.tar and /dev/null differ
diff --git a/packages/cloudrun/package.json b/packages/cloudrun/package.json
index 938457c50f..91b01f51ac 100644
--- a/packages/cloudrun/package.json
+++ b/packages/cloudrun/package.json
@@ -4,8 +4,9 @@
"description": "GCP Cloud Run alternative to lambda rendering",
"main": "dist/index.js",
"scripts": {
- "build": "tsc -d && pnpm run buildContainer",
+ "build": "tsc -d && pnpm run buildContainer && pnpm run tarInstaller",
"buildContainer": "ts-node src/admin/bundle-renderLogic.ts",
+ "tarInstaller": "mkdir ./temp && tar -cf ./temp/gcpInstaller.tar -C . --exclude='gcpInstaller/gcpInstaller.tar' gcpInstaller && mv ./temp/gcpInstaller.tar ./gcpInstaller && rmdir ./temp",
"start": "functions-framework --target=TypescriptFunction",
"watch": "tsc -w",
"lint": "eslint src --ext ts,tsx"
@@ -47,4 +48,4 @@
]
}
}
-}
+}
\ No newline at end of file
diff --git a/packages/docs/docs/cloudrun/generateEnvFile.md b/packages/docs/docs/cloudrun/generateEnvFile.md
index 1cd65e2b60..8c7e77a763 100644
--- a/packages/docs/docs/cloudrun/generateEnvFile.md
+++ b/packages/docs/docs/cloudrun/generateEnvFile.md
@@ -21,7 +21,7 @@ GCP allows a maximum of 10 keys per service account. If you have already created
3. Within the Cloud Shell, type the following command, and select option 3. Follow the remaining prompts.
```bash
- curl --remote-name-all https://raw.githubusercontent.com/UmungoBungo/remotion/gcp-lambda-alternative/packages/cloudrun/{terraform/main.tf,install.mjs} && node install.mjs
+ curl --remote-name-all https://raw.githubusercontent.com/UmungoBungo/remotion/gcp-lambda-alternative/packages/cloudrun/installer.zip && node install.mjs
```
<!-- ToDo - host this in the official Remotion repo -->