From 57ac0b9dd6f6bb90a564bdbb8858946caa6684af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Aug 2021 15:58:40 +0100 Subject: [PATCH] Bump ec2 from 1.44 to 1.63 (#1658) * Bump ec2 from 1.44 to 1.63 Bumps [ec2](https://github.com/jenkinsci/ec2-plugin) from 1.44 to 1.63. - [Release notes](https://github.com/jenkinsci/ec2-plugin/releases) - [Changelog](https://github.com/jenkinsci/ec2-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/ec2-plugin/compare/ec2-1.44...ec2-1.63) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:ec2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump ec2 from 1.44 to 1.63 Bumps [ec2](https://github.com/jenkinsci/ec2-plugin) from 1.44 to 1.63. - [Release notes](https://github.com/jenkinsci/ec2-plugin/releases) - [Changelog](https://github.com/jenkinsci/ec2-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/ec2-plugin/compare/ec2-1.44...ec2-1.63) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:ec2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update ec2 demo Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tim Jacomb --- demos/ec2/README.md | 4 ++-- integrations/pom.xml | 4 ++-- .../java/io/jenkins/plugins/casc/EC2CloudTest.java | 12 +++--------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/demos/ec2/README.md b/demos/ec2/README.md index 3421b0c7..9b90d53c 100644 --- a/demos/ec2/README.md +++ b/demos/ec2/README.md @@ -16,7 +16,7 @@ x-ec2_anchor: &ec2_anchor monitoring: false numExecutors: 1 stopOnTerminate: false - useDedicatedTenancy: false + tenancy: Default useEphemeralDevices: false zone: "us-east-1" ami: "ami-0c6bb742864ffa3f3" @@ -39,7 +39,7 @@ jenkins: # but let's be explicit to avoid issues. useInstanceProfileForCredentials: true # Reminder: the following key has multiple lines - privateKey: "${EC2_PRIVATE_KEY}" + sshKeysCredentialsId: "ssh-key-credential-id" noDelayProvisioning: true region: "eu-central-1" templates: diff --git a/integrations/pom.xml b/integrations/pom.xml index 7bfc9736..d025b027 100644 --- a/integrations/pom.xml +++ b/integrations/pom.xml @@ -384,7 +384,7 @@ org.jenkins-ci.plugins aws-credentials - 1.28 + 1.29 test @@ -405,7 +405,7 @@ org.jenkins-ci.plugins ec2 - 1.44 + 1.63 test diff --git a/integrations/src/test/java/io/jenkins/plugins/casc/EC2CloudTest.java b/integrations/src/test/java/io/jenkins/plugins/casc/EC2CloudTest.java index 8782a443..487798d1 100644 --- a/integrations/src/test/java/io/jenkins/plugins/casc/EC2CloudTest.java +++ b/integrations/src/test/java/io/jenkins/plugins/casc/EC2CloudTest.java @@ -12,8 +12,6 @@ import java.util.List; import jenkins.model.Jenkins; import org.junit.Rule; import org.junit.Test; -import org.junit.contrib.java.lang.system.EnvironmentVariables; -import org.junit.rules.RuleChain; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; @@ -28,18 +26,16 @@ import static org.junit.Assert.assertTrue; public class EC2CloudTest { @Rule - public RuleChain chain = RuleChain.outerRule(new EnvironmentVariables() - .set("EC2_PRIVATE_KEY", "ADMIN123")) - .around(new JenkinsConfiguredWithReadmeRule()); + public JenkinsConfiguredWithReadmeRule j = new JenkinsConfiguredWithReadmeRule(); @Test @ConfiguredWithReadme("ec2/README.md") - public void configure_ec2_cloud() throws Exception { + public void configure_ec2_cloud() { final AmazonEC2Cloud ec2Cloud = (AmazonEC2Cloud) Jenkins.get().getCloud("ec2-ec2"); assertNotNull(ec2Cloud); assertTrue(ec2Cloud.isUseInstanceProfileForCredentials()); - assertThat(ec2Cloud.getPrivateKey().getPrivateKey(), is("ADMIN123")); + assertThat(ec2Cloud.getSshKeysCredentialsId(), is("ssh-key-credential-id")); final List templates = ec2Cloud.getTemplates(); assertThat(templates, hasSize(2)); @@ -51,7 +47,6 @@ public class EC2CloudTest { assertFalse(slaveTemplate.ebsOptimized); assertFalse(slaveTemplate.monitoring); assertFalse(slaveTemplate.stopOnTerminate); - assertFalse(slaveTemplate.getUseDedicatedTenancy()); assertFalse(slaveTemplate.useEphemeralDevices); assertThat(slaveTemplate.type, is(InstanceType.T2Small)); assertThat(slaveTemplate.getAmi(), equalTo("ami-0c6bb742864ffa3f3")); @@ -83,7 +78,6 @@ public class EC2CloudTest { assertFalse(slaveTemplate.ebsOptimized); assertFalse(slaveTemplate.monitoring); assertFalse(slaveTemplate.stopOnTerminate); - assertFalse(slaveTemplate.getUseDedicatedTenancy()); assertFalse(slaveTemplate.useEphemeralDevices); assertThat(slaveTemplate.type, is(InstanceType.T2Xlarge)); assertThat(slaveTemplate.getAmi(), equalTo("ami-0c6bb742864ffa3f3"));