Add project to promotion url.
Along the way also remove unused code. See #75
This commit is contained in:
@@ -42,9 +42,6 @@ import org.springframework.web.util.UriTemplate;
|
||||
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
|
||||
public class DefaultDeploymentInformation implements DeploymentInformation {
|
||||
|
||||
private static UriTemplate REPOSITORY_TEMPLATE = new UriTemplate(
|
||||
"artifactory::default::{server};build.number={buildNumber};build.name={buildName}");
|
||||
|
||||
private final @Getter @NonNull ModuleIteration module;
|
||||
private final @NonNull DeploymentProperties properties;
|
||||
private final @Getter String buildNumber;
|
||||
@@ -124,20 +121,6 @@ public class DefaultDeploymentInformation implements DeploymentInformation {
|
||||
return authentication.getRepositoryPrefix().concat(authentication.getTargetRepository());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.release.deployment.DeploymentInformation#getDeploymentTargetUrl()
|
||||
*/
|
||||
@Override
|
||||
public String getDeploymentTargetUrl() {
|
||||
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("server", authentication.getTargetRepository());
|
||||
parameters.putAll(getBuildInfoParameters());
|
||||
|
||||
return REPOSITORY_TEMPLATE.expand(parameters).toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.release.deployment.DeploymentInformation#getBuildInfoParameters()
|
||||
@@ -148,6 +131,7 @@ public class DefaultDeploymentInformation implements DeploymentInformation {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("buildNumber", getBuildNumber());
|
||||
parameters.put("buildName", getBuildName());
|
||||
parameters.put("project", getProject());
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@@ -48,13 +48,6 @@ public interface DeploymentInformation {
|
||||
*/
|
||||
String getProject();
|
||||
|
||||
/**
|
||||
* Returns the full URL to be used as deployment target.
|
||||
*
|
||||
* @return will never be {@literal null} or empty.
|
||||
*/
|
||||
String getDeploymentTargetUrl();
|
||||
|
||||
/**
|
||||
* Returns the name of the repository to deploy to.
|
||||
*
|
||||
|
||||
@@ -53,8 +53,8 @@ public class DeploymentProperties {
|
||||
@Data
|
||||
public static class Server {
|
||||
|
||||
private static final String PROMOTION_RESOURCE = "/api/build/promote/{buildName}/{buildNumber}";
|
||||
private static final String DELETE_BUILD_RESOURCE = "/api/build/{buildName}?buildNumbers={buildNumber}&artifacts=1";
|
||||
private static final String PROMOTION_RESOURCE = "/api/build/promote/{buildName}/{buildNumber}?project={project}";
|
||||
private static final String DELETE_BUILD_RESOURCE = "/api/build/{buildName}?buildNumbers={buildNumber}&artifacts=1&project={project}";
|
||||
private static final String VERIFICATION_RESOURCE = "/api/storage/{verificationResource}";
|
||||
|
||||
private String uri;
|
||||
|
||||
Reference in New Issue
Block a user