boolean isExcludeUsernameFromHttpUrl();
+ boolean isCleanCredHelperScript();
+
/**
* Defines how progress output from git commands is written into build log
*/
public static final String FETCH_ALL_HEADS = "teamcity.git.fetchAllHeads";
public static final String FETCH_TAGS = "teamcity.git.fetchTags";
public static final String EXCLUDE_USERNAME_FROM_HTTP_URL = "teamcity.git.excludeUsernameFromHttpUrl";
+ public static final String CLEAN_CRED_HELPER_SCRIPT = "teamcity.git.cleanCredHelperScript";
private final BuildAgentConfiguration myAgentConfig;
private final AgentRunningBuild myBuild;
return !"false".equals(value);
}
+ @Override
+ public boolean isCleanCredHelperScript() {
+ String value = myBuild.getSharedConfigParameters().get(CLEAN_CRED_HELPER_SCRIPT);
+ return !"false".equals(value);
+ }
+
private int parseTimeout(String valueFromBuild) {
return parseTimeout(valueFromBuild, DEFAULT_IDLE_TIMEOUT);
}
for (Map.Entry<String, String> e : config.getEnv().entrySet()) {
command.setEnv(e.getKey(), e.getValue());
}
- command.addPostAction(new Runnable() {
- @Override
- public void run() {
- FileUtil.delete(credHelper);
- }
- });
+ if (myPluginConfig.isCleanCredHelperScript()) {
+ command.addPostAction(new Runnable() {
+ @Override
+ public void run() {
+ FileUtil.delete(credHelper);
+ }
+ });
+ }
} catch (Exception e) {
if (credentialsHelper != null)
FileUtil.delete(credentialsHelper);
script = script.replace("{CREDENTIALS_SCRIPT}", result.getCanonicalPath());
script = script.replace("{CREDENTIALS_CLASSPATH}", ClasspathUtil.composeClasspath(new Class[]{CredentialsHelper.class}, null, null));
script = script.replace("{CREDENTIALS_CLASS}", CredentialsHelper.class.getName());
- out.print(script);
+ String[] lines = script.split("(\r\n|\r|\n)");
+ for (String line : lines) {
+ out.println(line);
+ }
if (!result.setExecutable(true))
throw new IOException("Cannot make credentialsHelper script executable");
} catch (IOException e) {