-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.mjs
More file actions
31 lines (26 loc) · 912 Bytes
/
index.mjs
File metadata and controls
31 lines (26 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { setSatellitesController } from "@junobuild/admin";
import { defineRun } from "@junobuild/config";
export const onRun = defineRun(() => ({
run: async ({ identity, satelliteId, container }) => {
const controllerId = process.argv
.find((arg) => arg.indexOf(`--controllerId`) > -1)
?.replace(`--controllerId=`, "");
const profile = process.argv
.find((arg) => arg.indexOf(`--profile`) > -1)
?.replace(`--profile=`, "");
const missionControl = {
identity,
missionControlId: process.env.JUNO_MISSION_CONTROL_ID,
};
console.log(
`About to set ${controllerId} in satellite ${satelliteId} with the help of the mission control ${missionControl.missionControlId}.`,
);
await setSatellitesController({
missionControl,
satelliteIds: [satelliteId],
controllerId,
profile,
});
console.log("Done.");
},
}));