getLog().info("Gathering information from the version control system: "+ vcs);
VcsBuildInfo vcsInfo = vcsInfoGatherer.gatherVcsBuildInfo(getLog());
BuildServerBuildInformationGatherer buildServerInfoGatherer = null;
if (bambooBuildKey != null && bambooBuildNumber != null && bambooBuildTimeStamp != null){
buildServerInfoGatherer = new ChainingBuildServerGatherer(new
AtlassianBambooBuildInfoGatherer(bambooBuildKey, bambooBuildNumber, bambooBuildTimeStamp));
} else {
try {
Properties envVars = CommandLineUtils.getSystemEnvVars();
JenkinsBuildInfoGatherer jenkins = new JenkinsBuildInfoGatherer(envVars);
TeamCityBuildInfoGatherer teamCity = new TeamCityBuildInfoGatherer(envVars);
if(jenkins.isJenkinsInUse())
{
buildServerInfoGatherer = new ChainingBuildServerGatherer(jenkins);
}else if(teamCity.isTeamCityInUse()){
buildServerInfoGatherer = new ChainingBuildServerGatherer(teamCity);
}else{
getLog().info("Not using build server (Bamboo, Jenkins, TeamCity) configuration.");
}
} catch (IOException e) {
getLog().debug(String.format("Error gathering information: " + e.getMessage()));