Search in sources :

Example 1 with CloudSdkValidationResult

use of com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineDeploymentConfiguration method checkCommonConfig.

private void checkCommonConfig(AppEngineDeployable deployable) throws RuntimeConfigurationError {
    // do not check SDK if it supports dynamic install - the deployment runner will block itself
    // until installation is done.
    CloudSdkService cloudSdkService = CloudSdkService.getInstance();
    SdkStatus sdkStatus = cloudSdkService.getStatus();
    if (sdkStatus != SdkStatus.READY && !cloudSdkService.isInstallSupported()) {
        Set<CloudSdkValidationResult> sdkValidationResult = CloudSdkValidator.getInstance().validateCloudSdk();
        if (!sdkValidationResult.isEmpty()) {
            CloudSdkValidationResult result = Iterables.getFirst(sdkValidationResult, null);
            throw new RuntimeConfigurationError(GctBundle.message("appengine.flex.config.server.error", result.getMessage()));
        }
    }
    check(deployable instanceof UserSpecifiedPathDeploymentSource || deployable.isValid(), "appengine.config.deployment.source.error");
    check(StringUtils.isNotBlank(cloudProjectName), "appengine.flex.config.project.missing.message");
}
Also used : UserSpecifiedPathDeploymentSource(com.google.cloud.tools.intellij.appengine.cloud.flexible.UserSpecifiedPathDeploymentSource) CloudSdkService(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService) RuntimeConfigurationError(com.intellij.execution.configurations.RuntimeConfigurationError) SdkStatus(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus) CloudSdkValidationResult(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult)

Aggregations

UserSpecifiedPathDeploymentSource (com.google.cloud.tools.intellij.appengine.cloud.flexible.UserSpecifiedPathDeploymentSource)1 CloudSdkService (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService)1 SdkStatus (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus)1 CloudSdkValidationResult (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult)1 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)1