Search in sources :

Example 21 with DeploymentException

use of org.craftercms.studio.api.v1.service.deployment.DeploymentException in project studio by craftercms.

the class PublishingManagerImpl method markItemsBlocked.

@RetryingOperation
@Override
@ValidateParams
public void markItemsBlocked(@ValidateStringParam(name = "site") String site, @ValidateStringParam(name = "environment") String environment, List<PublishRequest> copyToEnvironmentItems) throws DeploymentException {
    for (PublishRequest item : copyToEnvironmentItems) {
        item.setState(PublishRequest.State.BLOCKED);
        publishRequestMapper.updateItemDeploymentState(item);
    }
}
Also used : PublishRequest(org.craftercms.studio.api.v1.dal.PublishRequest) RetryingOperation(org.craftercms.studio.api.v2.annotation.RetryingOperation) ValidateParams(org.craftercms.commons.validation.annotations.param.ValidateParams)

Example 22 with DeploymentException

use of org.craftercms.studio.api.v1.service.deployment.DeploymentException in project studio by craftercms.

the class BlobAwareContentRepositoryTest method publishMixFilesTest.

@Test
public void publishMixFilesTest() throws DeploymentException {
    DeploymentItemTO remoteItem = new DeploymentItemTO();
    remoteItem.setSite(SITE);
    remoteItem.setPath(ORIGINAL_PATH);
    DeploymentItemTO localItem = new DeploymentItemTO();
    localItem.setSite(SITE);
    localItem.setPath(LOCAL_PATH);
    DeploymentItemTO pointerItem = new DeploymentItemTO();
    pointerItem.setSite(SITE);
    pointerItem.setPath(POINTER_PATH);
    List<DeploymentItemTO> items = Arrays.asList(remoteItem, localItem);
    proxy.publish(SITE, EMPTY, items, ENV, USER, COMMENT);
    verify(store).publish(eq(SITE), eq(EMPTY), itemsCaptor.capture(), eq(ENV), eq(USER), eq(COMMENT));
    assertTrue(itemsCaptor.getValue().contains(remoteItem), "remote file should have been published");
    verify(localV2).publish(eq(SITE), eq(EMPTY), itemsCaptor.capture(), eq(ENV), eq(USER), eq(COMMENT));
    assertTrue(itemsCaptor.getValue().contains(pointerItem), "pointer file should have been published");
    verify(localV2).publish(eq(SITE), eq(EMPTY), itemsCaptor.capture(), eq(ENV), eq(USER), eq(COMMENT));
    assertTrue(itemsCaptor.getValue().contains(localItem), "local file should have been published");
}
Also used : DeploymentItemTO(org.craftercms.studio.api.v1.to.DeploymentItemTO) Test(org.testng.annotations.Test)

Aggregations

DeploymentException (org.craftercms.studio.api.v1.service.deployment.DeploymentException)12 DeploymentItemTO (org.craftercms.studio.api.v1.to.DeploymentItemTO)10 ValidateParams (org.craftercms.commons.validation.annotations.param.ValidateParams)9 ArrayList (java.util.ArrayList)8 PublishRequest (org.craftercms.studio.api.v1.dal.PublishRequest)8 ServiceLayerException (org.craftercms.studio.api.v1.exception.ServiceLayerException)6 SiteNotFoundException (org.craftercms.studio.api.v1.exception.SiteNotFoundException)6 ZonedDateTime (java.time.ZonedDateTime)5 HashSet (java.util.HashSet)5 CryptoException (org.craftercms.commons.crypto.CryptoException)4 IOException (java.io.IOException)3 RetryingOperation (org.craftercms.studio.api.v2.annotation.RetryingOperation)3 Test (org.testng.annotations.Test)3 SimpleDateFormat (java.text.SimpleDateFormat)2 ItemMetadata (org.craftercms.studio.api.v1.dal.ItemMetadata)2 SiteFeed (org.craftercms.studio.api.v1.dal.SiteFeed)2 ContentNotFoundException (org.craftercms.studio.api.v1.exception.ContentNotFoundException)2 InvalidRemoteRepositoryCredentialsException (org.craftercms.studio.api.v1.exception.repository.InvalidRemoteRepositoryCredentialsException)2 InvalidRemoteRepositoryException (org.craftercms.studio.api.v1.exception.repository.InvalidRemoteRepositoryException)2 RemoteRepositoryNotFoundException (org.craftercms.studio.api.v1.exception.repository.RemoteRepositoryNotFoundException)2