org.sonar.plugins.buildstability.ci.bamboo.BambooServer Maven / Gradle / Ivy
/*
* Copyright (C) 2010 Evgeny Mandrikov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sonar.plugins.buildstability.ci.bamboo;
import org.sonar.plugins.buildstability.ci.AbstractServer;
import org.sonar.plugins.buildstability.ci.Build;
import org.sonar.plugins.buildstability.ci.Unmarshaller;
/**
* See Bamboo REST APIs.
*
* @author Evgeny Mandrikov
*/
public class BambooServer extends AbstractServer {
public static final String SYSTEM = "Bamboo";
public static final String PATTERN = "/browse/";
private static final Unmarshaller BUILD_UNMARSHALLER = new BambooBuildUnmarshaller();
protected String getBuildUrl(String number) {
StringBuilder sb = new StringBuilder(getHost())
.append("/rest/api/latest/build/").append(getKey()).append("/").append(number)
.append("?os_authType=basic");
return sb.toString();
}
@Override
protected String getLastBuildUrl() {
return getBuildUrl("latest");
}
@Override
protected Unmarshaller getBuildUnmarshaller() {
return BUILD_UNMARSHALLER;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy