io.pivotal.services.plugin.tasks.CfAutoPilotTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ya-cf-app-gradle-plugin Show documentation
Show all versions of ya-cf-app-gradle-plugin Show documentation
Gradle Plugin to push an application to Cloud Foundry
package io.pivotal.services.plugin.tasks;
import io.pivotal.services.plugin.CfProperties;
import io.pivotal.services.plugin.tasks.helper.CfAutoPilotDelegate;
import org.cloudfoundry.operations.CloudFoundryOperations;
import org.gradle.api.tasks.TaskAction;
import reactor.core.publisher.Mono;
import java.time.Duration;
/**
* Responsible for an autpilot style deployment
*
* @author Biju Kunjummen
*/
public class CfAutoPilotTask extends AbstractCfTask {
private CfAutoPilotDelegate autoPilotTaskDelegate = new CfAutoPilotDelegate();
@TaskAction
public void runAutopilot() {
CloudFoundryOperations cfOperations = getCfOperations();
CfProperties originalProperties = getCfProperties();
Mono resp = autoPilotTaskDelegate.runAutopilot(getProject(), cfOperations, originalProperties);
resp.block(Duration.ofMillis(defaultWaitTimeout));
}
@Override
public String getDescription() {
return "Push an Application in a no downtime Autopilot mode";
}
}