private Collection<String> getDockerRunCommand(ECSSlave slave) { Collection<String> command = new ArrayList<String>(); command.add("-url"); command.add(JenkinsLocationConfiguration.get().getUrl()); if (StringUtils.isNotBlank(tunnel)) { command.add("-tunnel"); command.add(tunnel); } command.add(slave.getComputer().getJnlpMac()); command.add(slave.getComputer().getName()); return command; }
public static void sendMail(String[] addresses, String subject, String message) throws UnsupportedEncodingException, MessagingException { MimeMessage mimeMessage = new MimeMessage(Mailer.descriptor().createSession()); String adminAddress = JenkinsLocationConfiguration.get().getAdminAddress(); InternetAddress[] to = new InternetAddress[addresses.length]; for (int i = 0; i < addresses.length; i++) { to[i] = new InternetAddress(addresses[i], true); } mimeMessage.setSender(new InternetAddress(adminAddress)); mimeMessage.setRecipients(Message.RecipientType.TO, to); mimeMessage.setSubject(subject, "ISO-2022-JP"); mimeMessage.setText(message, "ISO-2022-JP"); Transport.send(mimeMessage); }