mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
37 lines
741 B
JavaScript
37 lines
741 B
JavaScript
|
#!/usr/bin/env zx
|
||
|
/**
|
||
|
* Provisions the cloud benchmark environment
|
||
|
*
|
||
|
* NOTE: Must be run in the root of the package.
|
||
|
*/
|
||
|
// @ts-check
|
||
|
import { which, minimist } from 'zx';
|
||
|
import { TerraformClient } from './clients/terraformClient.mjs';
|
||
|
|
||
|
const args = minimist(process.argv.slice(3), {
|
||
|
boolean: ['debug'],
|
||
|
});
|
||
|
|
||
|
const isVerbose = !!args.debug;
|
||
|
|
||
|
export async function provision() {
|
||
|
await ensureDependencies();
|
||
|
|
||
|
const terraformClient = new TerraformClient({
|
||
|
isVerbose,
|
||
|
});
|
||
|
|
||
|
await terraformClient.provisionEnvironment();
|
||
|
}
|
||
|
|
||
|
async function ensureDependencies() {
|
||
|
await which('terraform');
|
||
|
}
|
||
|
|
||
|
provision().catch((error) => {
|
||
|
console.error('An error occurred while provisioning cloud env:');
|
||
|
console.error(error);
|
||
|
|
||
|
process.exit(1);
|
||
|
});
|