| 59 | }; |
| 60 | |
| 61 | const deployTinybirdProject = (auth) => { |
| 62 | console.log( |
| 63 | "⚠️ Running `tb --cloud deploy --allow-destructive-operations --wait` inside scripts/analytics/tinybird. This will synchronize the Tinybird workspace to the resources defined in that folder and remove any other datasources/pipes in the workspace.", |
| 64 | ); |
| 65 | run( |
| 66 | TB_BINARY, |
| 67 | ["--cloud", "deploy", "--allow-destructive-operations", "--wait"], |
| 68 | { |
| 69 | cwd: tinybirdProjectDir, |
| 70 | env: { |
| 71 | ...process.env, |
| 72 | TB_HOST: auth.host, |
| 73 | TB_TOKEN: auth.token, |
| 74 | TB_LOCAL: "0", |
| 75 | ...(auth.userToken ? { TB_USER_TOKEN: auth.userToken } : {}), |
| 76 | }, |
| 77 | }, |
| 78 | ); |
| 79 | }; |
| 80 | |
| 81 | function main() { |
| 82 | try { |