Package hudson

Examples of hudson.EnvVars$GetEnvVars


      this.value = value;
    }
  }
 
  private static EnvVars toMap(List<Entry> entries) {
    EnvVars map = new EnvVars();
        if (entries!=null)
            for (Entry entry: entries)
                map.put(entry.key,entry.value);
    return map;
  }
View Full Code Here


            // resolve the relative path against the parent workspace, which needs locking
            FilePath baseDir = baseLease.path;

            // prepare variables that can be used in the child workspace setting
            EnvVars env = getEnvironment(listener);
            env.put("COMBINATION",getParent().getCombination().toString('/','/'))// e.g., "axis1/a/axis2/b"
            env.put("SHORT_COMBINATION",getParent().getDigestName());               // e.g., "0fbcab35"
            env.put("PARENT_WORKSPACE",baseDir.getRemote());

            // child workspace need no individual locks, whether or not we use custom workspace
            String childWs = mp.getChildCustomWorkspace();
            return Lease.createLinkedDummyLease(baseDir.child(env.expand(childWs)),baseLease);
        }
View Full Code Here

    @Override
    public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
        VariableResolver<String> vr = build.getBuildVariableResolver();

        EnvVars env = build.getEnvironment(listener);

        String targets = Util.replaceMacro(this.targets,vr);
        targets = env.expand(targets);
        String pom = env.expand(this.pom);
        String properties = env.expand(this.properties);

        int startIndex = 0;
        int endIndex;
        do {
            // split targets into multiple invokations of maven separated by |
View Full Code Here

    // //////////////////////// setup //////////////////////////////////////////

    public void setUp() throws Exception {
        super.setUp();
        EnvVars env = new EnvVars();
        // we don't want Maven, Ant, etc. to be discovered in the path for this test to work,
        // but on Unix these tools rely on other basic Unix tools (like env) for its operation,
        // so empty path breaks the test.
        env.put("PATH", "/bin:/usr/bin");
        env.put("M2_HOME", "empty");
        slave = createSlave(new LabelAtom("slave"), env);
        project = createFreeStyleProject();
        project.setAssignedLabel(slave.getSelfLabel());
    }
View Full Code Here

    public void testEnvMavenOptsNoneInProject() throws Exception {
        configureDefaultMaven();
        MavenModuleSet m = createMavenProject();
        m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
        m.setGoals("validate");
        m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
       
        buildAndAssertSuccess(m);

        assertLogContains("[hudson.mavenOpt.test=foo]", m.getLastBuild());
    }
View Full Code Here

        configureDefaultMaven();
        MavenModuleSet m = createMavenProject();
        m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
        m.setGoals("validate");
        m.setMavenOpts("-Dhudson.mavenOpt.test=bar");
        m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
       
        buildAndAssertSuccess(m);

        assertLogContains("[hudson.mavenOpt.test=bar]", m.getLastBuild());
    }
View Full Code Here

        configureDefaultMaven();
        MavenModuleSet m = createMavenProject();
        m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
        m.setGoals("validate");
        MavenModuleSet.DESCRIPTOR.setGlobalMavenOpts("-Dhudson.mavenOpt.test=bar");
        m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
        m.setMavenOpts("-Dhudson.mavenOpt.test=baz");
       
        buildAndAssertSuccess(m);

        assertLogContains("[hudson.mavenOpt.test=baz]", m.getLastBuild());
View Full Code Here

        configureDefaultMaven();
        MavenModuleSet m = createMavenProject();
        m.setMavenOpts("$FOO");
        m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
        m.setGoals("validate");
        m.setAssignedLabel(createSlave(new EnvVars("FOO", "-Dhudson.mavenOpt.test=foo -Dhudson.mavenOpt.test2=bar")).getSelfLabel());

        buildAndAssertSuccess(m);

        assertLogContains("[hudson.mavenOpt.test=foo]", m.getLastBuild());
    }
View Full Code Here

                        return args;
                    }

                    @Override
                    public synchronized EnvVars getEnvironmentVariables() {
                        if(env==null)   env = new EnvVars(p.getEnvironmentVariables());
                        return env;
                    }
                });

            }
View Full Code Here

        this.command = command;
    }

    @Override
    public CommandLauncher launch(String host, TaskListener listener) throws IOException, InterruptedException {
        return new CommandLauncher(command,new EnvVars("SLAVE",host));
    }
View Full Code Here

TOP

Related Classes of hudson.EnvVars$GetEnvVars

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.