Search in sources :

Example 1 with DeployApplicationRequest

use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.

the class ApplicationsDeploymentStepDefinitions method I_deploy_an_application_environment_for_application.

@Given("^I deploy an application environment \"([^\"]*)\" for application \"([^\"]*)\"$")
public void I_deploy_an_application_environment_for_application(String envName, String appName) throws Throwable {
    DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(appName, envName);
    deployApplicationRequest.setApplicationId(Context.getInstance().getApplicationId(appName));
    String response = deploy(deployApplicationRequest);
    Context.getInstance().registerRestResponse(response);
}
Also used : DeployApplicationRequest(alien4cloud.rest.application.model.DeployApplicationRequest) Given(cucumber.api.java.en.Given)

Example 2 with DeployApplicationRequest

use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.

the class ApplicationsDeploymentStepDefinitions method I_deploy_it.

@When("^I deploy it$")
public void I_deploy_it() throws Throwable {
    // deploys the current application on default "Environment"
    log.info("Deploy : Deploying the application " + ApplicationStepDefinitions.CURRENT_APPLICATION.getName());
    DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(ApplicationStepDefinitions.CURRENT_APPLICATION.getName(), null);
    String response = deploy(deployApplicationRequest);
    Context.getInstance().registerRestResponse(response);
}
Also used : DeployApplicationRequest(alien4cloud.rest.application.model.DeployApplicationRequest) When(cucumber.api.java.en.When)

Example 3 with DeployApplicationRequest

use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.

the class ApplicationsDeploymentStepDefinitions method I_deploy_the_application_on_the_location_without_waiting_for_the_end_of_deployment.

@Given("^I deploy the application \"([^\"]*)\" on the location \"([^\"]*)\"/\"([^\"]*)\" without waiting for the end of deployment$")
public void I_deploy_the_application_on_the_location_without_waiting_for_the_end_of_deployment(String appName, String orchestratorName, String locationName) throws Throwable {
    deploymentTopoSteps.I_Set_a_unique_location_policy_to_for_all_nodes(orchestratorName, locationName);
    DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(appName, null);
    deployApplicationRequest.setApplicationId(Context.getInstance().getApplication().getId());
    String response = deploy(deployApplicationRequest);
    Context.getInstance().registerRestResponse(response);
}
Also used : DeployApplicationRequest(alien4cloud.rest.application.model.DeployApplicationRequest) Given(cucumber.api.java.en.Given)

Example 4 with DeployApplicationRequest

use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.

the class ApplicationsDeploymentStepDefinitions method I_deploy_all_applications_on_the_location.

@When("^I deploy all applications on the location \"([^\"]*)\"/\"([^\"]*)\"$")
public void I_deploy_all_applications_on_the_location(String orchestratorName, String locationName) throws Throwable {
    assertNotNull(ApplicationStepDefinitions.CURRENT_APPLICATIONS);
    for (String key : ApplicationStepDefinitions.CURRENT_APPLICATIONS.keySet()) {
        Application app = ApplicationStepDefinitions.CURRENT_APPLICATIONS.get(key);
        Context.getInstance().registerApplication(app);
        deploymentTopoSteps.I_Set_a_unique_location_policy_to_for_all_nodes(orchestratorName, locationName);
        String appName = app.getName();
        Map<String, String> environments = Context.getInstance().getAllEnvironmentForApplication(appName);
        DeployApplicationRequest deployApplicationRequest = null;
        for (Map.Entry<String, String> env : environments.entrySet()) {
            String envName = env.getKey();
            deployApplicationRequest = getDeploymentAppRequest(appName, envName);
            String response = deploy(deployApplicationRequest);
            Context.getInstance().registerRestResponse(response);
        }
        commonSteps.I_should_receive_a_RestResponse_with_no_error();
    }
}
Also used : DeployApplicationRequest(alien4cloud.rest.application.model.DeployApplicationRequest) Application(alien4cloud.model.application.Application) Map(java.util.Map) When(cucumber.api.java.en.When)

Example 5 with DeployApplicationRequest

use of alien4cloud.rest.application.model.DeployApplicationRequest in project alien4cloud by alien4cloud.

the class ApplicationsDeploymentStepDefinitions method getDeploymentAppRequest.

public static DeployApplicationRequest getDeploymentAppRequest(String applicationName, String environmentName) throws IOException {
    DeployApplicationRequest deployApplicationRequest = new DeployApplicationRequest();
    Application application = ApplicationStepDefinitions.CURRENT_APPLICATION;
    // set application id and environment id for the request
    String applicationId = (applicationName == null) ? application.getId() : Context.getInstance().getApplicationId(applicationName);
    deployApplicationRequest.setApplicationId(applicationId);
    String environmentId = (environmentName == null) ? Context.getInstance().getDefaultApplicationEnvironmentId(applicationName) : Context.getInstance().getApplicationEnvironmentId(applicationName, environmentName);
    deployApplicationRequest.setApplicationEnvironmentId(environmentId);
    return deployApplicationRequest;
}
Also used : DeployApplicationRequest(alien4cloud.rest.application.model.DeployApplicationRequest) Application(alien4cloud.model.application.Application)

Aggregations

DeployApplicationRequest (alien4cloud.rest.application.model.DeployApplicationRequest)6 When (cucumber.api.java.en.When)3 Application (alien4cloud.model.application.Application)2 Given (cucumber.api.java.en.Given)2 Map (java.util.Map)1