Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for mac2.metal instance type #816

Merged
merged 4 commits into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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