@@ -131,32 +131,20 @@ async function startEc2Instance(label, githubRegistrationToken) {
131131 }
132132 }
133133
134- const ec2 = new EC2Client ( { region : process . env . AWS_REGION } ) ;
134+ // add root storage size if its been set
135+ if ( config . input . rootStorageGB ) {
136+ params [ "BlockDeviceMappings" ] = [
137+ {
138+ DeviceName : "/dev/sda1" ,
139+ "Ebs" : { "VolumeSize" : config . input . rootStorageGB }
140+ }
141+ ]
142+ }
135143
144+ const ec2 = new EC2Client ( { region : process . env . AWS_REGION } ) ;
136145 const command = new RunInstancesCommand ( params ) ;
137-
138- console . log ( "sendstart" )
139- const response = await ec2 . send ( command ) ; //, (err, data) => {
140- console . log ( "response" )
141- console . log ( response )
142- console . log ( "endresponse" )
143- console . log ( response . Instances . map ( x => x . InstanceId ) ) ;
146+ const response = await ec2 . send ( command ) ;
144147 return response . Instances . map ( x => x . InstanceId ) ;
145-
146- // const instanceIds = await sendstart(runInstancesCommand)
147- // return instanceIds
148- // await ec2.send(runInstancesCommand, (err, data) => {
149- // if (err) {
150- // console.log(err, err.stack);
151- // core.error(`AWS EC2 instance failed to start - error: ${err}`)
152- // throw err;
153- // } else {
154- // const ec2InstanceIds = data.Instances.map(x => x.InstanceId); //[0].InstanceId; pass all instances instead of just first id
155- // core.info(`AWS EC2 instance(s) ${ec2InstanceIds} is started`);
156- // return ec2InstanceIds;
157- // }
158- // });
159- // console.log("aftersend")
160148}
161149
162150async function terminateEc2Instance ( ) {
0 commit comments