MCPcopy Create free account
hub / github.com/api3dao/airnode / main

Function main

packages/airnode-examples/src/scripts/deploy-airnode.ts:5–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4// eslint-disable-next-line require-await
5const main = async () => {
6 const integrationInfo = readIntegrationInfo();
7 if (integrationInfo.airnodeType === 'local') {
8 cliPrint.error('You only need to run this script if you deploy on a cloud provider');
9 return;
10 }
11
12 // Use a command-line provided image name if a command line arg was passed (developer convenience).
13 // Otherwise, use the version from package.json.
14 const specificImage = process.argv.slice(2);
15 const packageVersion = readPackageVersion();
16 const imageName = specificImage.length === 1 ? specificImage : `api3/airnode-deployer:${packageVersion}`;
17
18 const integrationPath = join(__dirname, '../../integrations', integrationInfo.integration);
19 const deployCommand = [
20 `docker run -it --rm`,
21 isWindows() ? '' : `-e USER_ID=$(id -u) -e GROUP_ID=$(id -g)`,
22 `-v ${integrationPath}:/app/config`,
23 `${imageName} deploy --debug`,
24 ]
25 .filter(Boolean)
26 .join(' ');
27
28 runShellCommand(deployCommand);
29};
30
31runAndHandleErrors(main);

Callers

nothing calls this directly

Calls 4

readIntegrationInfoFunction · 0.85
readPackageVersionFunction · 0.85
isWindowsFunction · 0.85
runShellCommandFunction · 0.85

Tested by

no test coverage detected