Search in sources :

Example 6 with EnvVars

use of hudson.EnvVars in project pipeline-aws-plugin by jenkinsci.

the class WithAWSStepTest method testSettingEndpointUrl.

@Test
public void testSettingEndpointUrl() throws Exception {
    final EnvVars envVars = new EnvVars();
    envVars.put(AWSClientFactory.AWS_ENDPOINT_URL, "https://minio.mycompany.com");
    envVars.put(AWSClientFactory.AWS_REGION, Regions.DEFAULT_REGION.getName());
    final AmazonS3ClientBuilder amazonS3ClientBuilder = AWSClientFactory.configureBuilder(AmazonS3ClientBuilder.standard(), envVars);
    Assert.assertEquals("https://minio.mycompany.com", amazonS3ClientBuilder.getEndpoint().getServiceEndpoint());
}
Also used : EnvVars(hudson.EnvVars) AmazonS3ClientBuilder(com.amazonaws.services.s3.AmazonS3ClientBuilder) Test(org.junit.Test)

Example 7 with EnvVars

use of hudson.EnvVars in project pipeline-aws-plugin by jenkinsci.

the class ProxyTest method shouldParseProxyLowerCase.

@Test
public void shouldParseProxyLowerCase() throws Exception {
    EnvVars vars = new EnvVars();
    vars.put(ProxyConfiguration.HTTPS_PROXY_LC, "http://127.0.0.1:8888/");
    ClientConfiguration config = new ClientConfiguration();
    config.setProtocol(Protocol.HTTPS);
    ProxyConfiguration.configure(vars, config);
    Assert.assertNull(config.getProxyUsername());
    Assert.assertNull(config.getProxyPassword());
    Assert.assertEquals("127.0.0.1", config.getProxyHost());
    Assert.assertEquals(8888, config.getProxyPort());
}
Also used : EnvVars(hudson.EnvVars) ClientConfiguration(com.amazonaws.ClientConfiguration) Test(org.junit.Test)

Example 8 with EnvVars

use of hudson.EnvVars in project pipeline-aws-plugin by jenkinsci.

the class ProxyTest method shouldSetNonProxyHosts.

@Test
public void shouldSetNonProxyHosts() throws Exception {
    EnvVars vars = new EnvVars();
    vars.put(ProxyConfiguration.NO_PROXY, "127.0.0.1,localhost");
    vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1:8888/");
    ClientConfiguration config = new ClientConfiguration();
    config.setProtocol(Protocol.HTTPS);
    ProxyConfiguration.configure(vars, config);
    Assert.assertEquals("127.0.0.1|localhost", config.getNonProxyHosts());
}
Also used : EnvVars(hudson.EnvVars) ClientConfiguration(com.amazonaws.ClientConfiguration) Test(org.junit.Test)

Example 9 with EnvVars

use of hudson.EnvVars in project pipeline-aws-plugin by jenkinsci.

the class ProxyTest method shouldSetNonProxyHostsLowerCase.

@Test
public void shouldSetNonProxyHostsLowerCase() throws Exception {
    EnvVars vars = new EnvVars();
    vars.put(ProxyConfiguration.NO_PROXY_LC, "127.0.0.1,localhost");
    vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1:8888/");
    ClientConfiguration config = new ClientConfiguration();
    config.setProtocol(Protocol.HTTPS);
    ProxyConfiguration.configure(vars, config);
    Assert.assertEquals("127.0.0.1|localhost", config.getNonProxyHosts());
}
Also used : EnvVars(hudson.EnvVars) ClientConfiguration(com.amazonaws.ClientConfiguration) Test(org.junit.Test)

Example 10 with EnvVars

use of hudson.EnvVars in project pipeline-aws-plugin by jenkinsci.

the class ProxyTest method shouldParseProxyWithoutPort.

@Test
public void shouldParseProxyWithoutPort() throws Exception {
    EnvVars vars = new EnvVars();
    vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1/");
    ClientConfiguration config = new ClientConfiguration();
    config.setProtocol(Protocol.HTTPS);
    ProxyConfiguration.configure(vars, config);
    Assert.assertNull(config.getProxyUsername());
    Assert.assertNull(config.getProxyPassword());
    Assert.assertEquals("127.0.0.1", config.getProxyHost());
    Assert.assertEquals(443, config.getProxyPort());
}
Also used : EnvVars(hudson.EnvVars) ClientConfiguration(com.amazonaws.ClientConfiguration) Test(org.junit.Test)

Aggregations

EnvVars (hudson.EnvVars)64 Test (org.junit.Test)23 IOException (java.io.IOException)15 FilePath (hudson.FilePath)11 ClientConfiguration (com.amazonaws.ClientConfiguration)7 ArgumentListBuilder (hudson.util.ArgumentListBuilder)7 TaskListener (hudson.model.TaskListener)6 AbortException (hudson.AbortException)5 HashMap (java.util.HashMap)5 MavenModuleSet (hudson.maven.MavenModuleSet)4 FreeStyleProject (hudson.model.FreeStyleProject)4 ParameterValue (hudson.model.ParameterValue)4 Launcher (hudson.Launcher)3 GitException (hudson.plugins.git.GitException)3 LogTaskListener (hudson.util.LogTaskListener)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 NodeJSInstallation (jenkins.plugins.nodejs.tools.NodeJSInstallation)3 ConduitAPIClient (com.uber.jenkins.phabricator.conduit.ConduitAPIClient)2 ConduitAPIException (com.uber.jenkins.phabricator.conduit.ConduitAPIException)2