Package hudson

Examples of hudson.EnvVars


public class GroovyYamlTemplateProcessorTest {

    @Test
    public void should_filter_out_elements_that_are_filter_out_by_if_conditions() {
        EnvVars envVars = new EnvVars();
        envVars.put("DOTCI_BRANCH", "gh-pages");
        GroovyYamlTemplateProcessor effectiveConfiguration = new GroovyYamlTemplateProcessor(ResourceUtils.readResource(getClass(), ".ci_skip_versions.yml"), envVars);
        Map<?, ?> config = effectiveConfiguration.getConfig();
        assertNotNull(config);
        List<?> langugeVersions = (List<?>) ((Map<?, ?>) config.get("environment")).get("language_versions");
        assertEquals(1, langugeVersions.size());
View Full Code Here


        assertEquals(1, langugeVersions.size());
    }

    @Test
    public void should_export_missing_variables_asis() {
        EnvVars envVars = new EnvVars();
        envVars.put("NOT_MISSING_PROP", "1.9.0");
        GroovyYamlTemplateProcessor effectiveConfiguration = new GroovyYamlTemplateProcessor(ResourceUtils.readResource(getClass(),".ci_missing_props.yml"), envVars);
        Map<?, ?> config = effectiveConfiguration.getConfig();
        assertNotNull(config);
        Map<?, ?> env = (Map<?, ?>) config.get("environment");
        List<?> versions = (List<?>) env.get("language_versions");
View Full Code Here

        assertEquals("1.9.0", versions.get(1));
    }

    @Test
    public void should_not_subsitute_PATH() {
        EnvVars envVars = new EnvVars();
        envVars.put("PATH", "/PATH/BIN");
        GroovyYamlTemplateProcessor effectiveConfiguration = new GroovyYamlTemplateProcessor(ResourceUtils.readResource(getClass(),".ci_PATH.yml"), envVars);
        Map<?, ?> config = effectiveConfiguration.getConfig();
        assertNotNull(config);
        Object run = ((Map<?, ?>) config.get("build")).get("run");
        assertEquals("echo $PATH", run);
View Full Code Here

        assertEquals("echo $PATH", run);
    }

    @Test
    public void should_return_null_for_missing_DOTCI_vars() {
        EnvVars envVars = new EnvVars();
        envVars.put("DOTCI_PULL_REQUEST", "1");
        GroovyYamlTemplateProcessor effectiveConfiguration = new GroovyYamlTemplateProcessor(ResourceUtils.readResource(getClass(),".ci_pr.yml"), envVars);
        Map<?, ?> config = effectiveConfiguration.getConfig();
        assertNotNull(config);
        Object run = ((Map<?, ?>) config.get("build")).get("run");
        assertEquals("echo pr 1", run);
View Full Code Here

    public abstract DockerBuildConfiguration getBuildConfiguration(Map config, String buildId, EnvVars buildEnvironment) ;

    @Override
    public Result runBuild(DynamicBuild build, BuildExecutionContext buildExecutionContext, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
        try{
            EnvVars buildEnvironment = build.getEnvironment(listener);
            Map config = new GroovyYamlTemplateProcessor(getDotCiYml(build), buildEnvironment).getConfig();
            this.buildConfiguration = getBuildConfiguration(config,build.getBuildId(),buildEnvironment);
            build.setAxisList(buildConfiguration.getAxisList());
            Result result ;
            if(buildConfiguration.isParallized()){
View Full Code Here

public class BuildConfigurationTest {

    @Test
    public void should_skip_build_if_build_is_skipped() {
        String dotCiYml = ResourceUtils.readResource(getClass(),"ci_skip_build.yml");
        BuildConfiguration config = new BuildConfiguration(dotCiYml, new EnvVars());
        assertTrue(config.isSkipped());
    }
View Full Code Here

    @Test
    public void should_load_base_templates(){
        DotCiTemplate rubyTemplate = new DotCiTemplate().getTemplates().get("ruby");
        Assert.assertNotNull(rubyTemplate);
        BuildConfiguration buildConfiguration = rubyTemplate.getBuildConfiguration(new EnvVars());
        Assert.assertNotNull(buildConfiguration);
    }
View Full Code Here

    public abstract BuildCause getCause();

    @Override
    public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
        EnvVars envVars = getJenkinsEnvVariables(log);
        envVars.putAll(getDotCiEnvVars(envVars));
        return envVars;
    }
View Full Code Here

        @Override
        protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws InterruptedException, IOException {
            Lease baseLease = getParentWorkspaceLease(n, wsl);
            FilePath baseDir = baseLease.path;
            EnvVars env = getEnvironment(listener);
            env.putAll(getBuildVariables());
            String childWs = getParent().getName();
            return Lease.createLinkedDummyLease(baseDir.child(env.expand(childWs)), baseLease);
        }
View Full Code Here

        AntInstallation antInstallation = new AntInstallation("varAnt",
                withVariable(ant.getHome()),NO_PROPERTIES);
        hudson.getDescriptorByType(Ant.DescriptorImpl.class).setInstallations(antInstallation);

    // create slaves
    EnvVars additionalEnv = new EnvVars(DUMMY_LOCATION_VARNAME, "");
    slaveEnv = createSlave(new LabelAtom("slaveEnv"), additionalEnv);
    slaveRegular = createSlave(new LabelAtom("slaveRegular"));
  }
View Full Code Here

TOP

Related Classes of hudson.EnvVars

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.