private String getExpandedRemote(AbstractBuild<?,?> build) { String outRemote = remote; ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) outRemote = parameters.substitute(build, remote); return outRemote; }
private String getExpandedRemote(AbstractBuild<?, ?> build) { String outRemote = remote; ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { outRemote = parameters.substitute(build, remote); } return outRemote; }
private String getExpandedRemote(AbstractBuild<?, ?> build) { String outRemote = remote; ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { outRemote = parameters.substitute(build, remote); } return outRemote; }
/** * Builds branch based on params.Applied build params if any. Returns null if branch contains *, * * @param build {@link AbstractBuild} * @param repository repo name * @param branchName branch name * @return branch name */ public static String buildBranch(AbstractBuild<?, ?> build, String repository, String branchName) { // replace repository wildcard with repository name if (branchName.startsWith("*/")) { branchName = repository + branchName.substring(1); } // if the branchName name contains more wildcards then the simple usecase // does not apply and we need to skip to the advanced usecase if (branchName.contains("*")) { return null; } // substitute build parameters if available ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { branchName = parameters.substitute(build, branchName); } return branchName; }
public String getParamLocalBranch(AbstractBuild<?, ?> build) { String branch = getLocalBranch(); // substitute build parameters if available ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { branch = parameters.substitute(build, branch); } return branch; } @Deprecated
public String getParamLocalBranch(AbstractBuild<?, ?> build) { String branch = getLocalBranch(); // substitute build parameters if available ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { branch = parameters.substitute(build, branch); } return branch; }
private String substituteBuildParameter(final Run<?, ?> run, final String text) { if (run instanceof AbstractBuild<?, ?>) { AbstractBuild<?, ?> build = (AbstractBuild<?, ?>) run; if (build.getAction(ParametersAction.class) != null) { return build.getAction(ParametersAction.class).substitute(build, text); } } return text; }
private String getRefSpec(RemoteConfig repo, AbstractBuild<?, ?> build) { String refSpec = repo.getFetchRefSpecs().get(0).toString(); ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { refSpec = parameters.substitute(build, refSpec); } return refSpec; }
private String getRefSpec(RemoteConfig repo, AbstractBuild<?, ?> build) { String refSpec = repo.getFetchRefSpecs().get(0).toString(); ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { refSpec = parameters.substitute(build, refSpec); } return refSpec; }
/** * @deprecated This method is used by {@link #getExpandedLocation(AbstractBuild)} * which is deprecated since it expands variables only based * on build parameters. */ private String getExpandedLocalDir(AbstractBuild<?,?> build) { String outLocalDir = getLocalDir(); ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) outLocalDir = parameters.substitute(build, getLocalDir()); return outLocalDir; }
/** * If the configuration is such that we are tracking just one branch of one repository * return that branch specifier (in the form of something like "origin/master" * <p/> * Otherwise return null. */ private String getSingleBranch(AbstractBuild<?, ?> build) { // if we have multiple branches skip to advanced usecase if (getBranches().size() != 1 || getRepositories().size() != 1) { return null; } String branch = getBranches().get(0).getName(); String repository = getRepositories().get(0).getName(); // replace repository wildcard with repository name if (branch.startsWith("*/")) { branch = repository + branch.substring(1); } // if the branch name contains more wildcards then the simple usecase // does not apply and we need to skip to the advanced usecase if (branch.contains("*")) { return null; } // substitute build parameters if available ParametersAction parameters = build.getAction(ParametersAction.class); if (parameters != null) { branch = parameters.substitute(build, branch); } return branch; }
param = parameters.substitute(build, param);