Skip to content

Commit 4c92334

Browse files
author
Paul Ashton
committed
Merge remote-tracking branch 'origin/main'
2 parents 6a222b2 + 56ff556 commit 4c92334

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

dist/index.js

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -160435,32 +160435,20 @@ async function startEc2Instance(label, githubRegistrationToken) {
160435160435
}
160436160436
}
160437160437

160438-
const ec2 = new EC2Client({region: process.env.AWS_REGION});
160438+
// add root storage size if its been set
160439+
if (config.input.rootStorageGB) {
160440+
params["BlockDeviceMappings"] = [
160441+
{
160442+
DeviceName: "/dev/sda1",
160443+
"Ebs": { "VolumeSize": config.input.rootStorageGB }
160444+
}
160445+
]
160446+
}
160439160447

160448+
const ec2 = new EC2Client({region: process.env.AWS_REGION});
160440160449
const command = new RunInstancesCommand(params);
160441-
160442-
console.log("sendstart")
160443-
const response = await ec2.send(command); //, (err, data) => {
160444-
console.log("response")
160445-
console.log(response)
160446-
console.log("endresponse")
160447-
console.log(response.Instances.map(x => x.InstanceId));
160450+
const response = await ec2.send(command);
160448160451
return response.Instances.map(x => x.InstanceId);
160449-
160450-
// const instanceIds = await sendstart(runInstancesCommand)
160451-
// return instanceIds
160452-
// await ec2.send(runInstancesCommand, (err, data) => {
160453-
// if (err) {
160454-
// console.log(err, err.stack);
160455-
// core.error(`AWS EC2 instance failed to start - error: ${err}`)
160456-
// throw err;
160457-
// } else {
160458-
// const ec2InstanceIds = data.Instances.map(x => x.InstanceId); //[0].InstanceId; pass all instances instead of just first id
160459-
// core.info(`AWS EC2 instance(s) ${ec2InstanceIds} is started`);
160460-
// return ec2InstanceIds;
160461-
// }
160462-
// });
160463-
// console.log("aftersend")
160464160452
}
160465160453

160466160454
async function terminateEc2Instance() {
@@ -160530,6 +160518,7 @@ class Config {
160530160518
numRunners: core.getInput('num-runners'),
160531160519
numInstances: core.getInput('num-instances'),
160532160520
useSpotInstances: core.getInput('use-spot-instances'),
160521+
rootStorageGB: core.getInput('root-storage-gb'),
160533160522
};
160534160523

160535160524
const tags = JSON.parse(core.getInput('aws-resource-tags'));

0 commit comments

Comments
 (0)