@Override public boolean start() throws Exception { Map<String, String> overridesM = new HashMap<>(); for (String pair : overrides) { int split = pair.indexOf('='); assert split != -1; overridesM.put(pair.substring(0, split), pair.substring(split + 1)); } getContext().newBodyInvoker(). withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), EnvironmentExpander.constant(overridesM))). withCallback(BodyExecutionCallback.wrap(getContext())). start(); return false; }
/** * {@inheritDoc} */ @Override public boolean start() throws Exception { StepContext context = getContext(); EnvironmentExpander currentEnvironment = context.get(EnvironmentExpander.class); EnvironmentExpander terminalEnvironment = EnvironmentExpander.constant(Collections.singletonMap("TERM", step.getColorMapName())); context.newBodyInvoker().withContext(createConsoleLogFilter(context)) .withContext(EnvironmentExpander.merge(currentEnvironment, terminalEnvironment)) .withCallback(BodyExecutionCallback.wrap(context)).start(); return false; }
/** * {@inheritDoc} */ @Override public boolean start() throws Exception { StepContext context = getContext(); context.get(Run.class).replaceAction(new ColorizedAction(colorMapName)); EnvironmentExpander currentEnvironment = context.get(EnvironmentExpander.class); EnvironmentExpander terminalEnvironment = EnvironmentExpander.constant(Collections.singletonMap("TERM", colorMapName)); context.newBodyInvoker() .withContext(EnvironmentExpander.merge(currentEnvironment, terminalEnvironment)) .withCallback(BodyExecutionCallback.wrap(context)).start(); return false; }
.withContexts( EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), EnvironmentExpander.constant(Collections.singletonMap("WORKSPACE", workspace.getRemote()))), workspace) .withCallback(new Callback(lease))