Skip to content

Commit

Permalink
Merge pull request #816 from ykhandelwal913/master
Browse files Browse the repository at this point in the history
Adding rosetta terminal support for mac2.metal instance type
  • Loading branch information
res0nance authored Mar 8, 2023
2 parents 8c66f5f + 93a21b6 commit e4062f0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/hudson/plugins/ec2/ssh/EC2MacLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,18 @@ protected void launchScript(EC2Computer computer, TaskListener listener) throws

// TODO: parse the version number. maven-enforcer-plugin might help
final String javaPath = node.javaPath;
executeRemote(computer, conn, javaPath + " -fullversion", "curl -L -O https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg; sudo installer -pkg amazon-corretto-8-x64-macos-jdk.pkg -target /", logger, listener);
try {
Instance nodeInstance = computer.describeInstance();
if (nodeInstance.getInstanceType().equals("mac2.metal")) {
LOGGER.info("Running Command for mac2.metal");
executeRemote(computer, conn, javaPath + " -fullversion", "curl -L -O https://corretto.aws/downloads/latest/amazon-corretto-11-aarch64-macos-jdk.pkg; sudo installer -pkg amazon-corretto-11-aarch64-macos-jdk.pkg -target /", logger, listener);
}
else{
executeRemote(computer, conn, javaPath + " -fullversion", "curl -L -O https://corretto.aws/downloads/latest/amazon-corretto-11-x64-macos-jdk.pkg; sudo installer -pkg amazon-corretto-11-x64-macos-jdk.pkg -target /", logger, listener);
}
} catch (InterruptedException ex) {
LOGGER.warning(ex.getMessage());
}

// Always copy so we get the most recent remoting.jar
logInfo(computer, listener, "Copying remoting.jar to: " + tmpDir);
Expand Down

0 comments on commit e4062f0

Please sign in to comment.