Search in sources :

Example 1 with AppEngineHelper

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

the class AppEngineFlexibleDeployTask method execute.

@Override
public void execute(ProcessStartListener startListener) {
    UsageTrackerProvider.getInstance().trackEvent(GctTracking.APP_ENGINE_DEPLOY).addMetadata(GctTracking.METADATA_LABEL_KEY, "flex").ping();
    Path stagingDirectory;
    AppEngineHelper helper = deploy.getHelper();
    try {
        stagingDirectory = helper.createStagingDirectory(deploy.getLoggingHandler(), deploy.getDeploymentConfiguration().getCloudProjectName());
    } catch (IOException ioe) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.deployment.error.creating.staging.directory"));
        logger.warn(ioe);
        return;
    }
    try {
        if (!flexibleStage.stage(stagingDirectory)) {
            String message = GctBundle.message("appengine.deployment.exception.during.staging");
            deploy.getCallback().errorOccurred(message);
            logger.warn(message);
            return;
        }
    } catch (IOException e) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.deployment.exception.during.staging"));
        logger.error(e);
        return;
    }
    try {
        if (helper.stageCredentials(deploy.getDeploymentConfiguration().getGoogleUsername()) == null) {
            deploy.getCallback().errorOccurred(GctBundle.message("appengine.staging.credentials.error.message"));
            return;
        }
        deploy.deploy(stagingDirectory, startListener);
    } catch (RuntimeException re) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.deployment.exception") + "\n" + GctBundle.message("appengine.action.error.update.message"));
        logger.error(re);
    }
}
Also used : Path(java.nio.file.Path) AppEngineHelper(com.google.cloud.tools.intellij.appengine.cloud.AppEngineHelper) IOException(java.io.IOException)

Example 2 with AppEngineHelper

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

the class AppEngineStandardDeployTask method execute.

@Override
public void execute(ProcessStartListener startListener) {
    UsageTrackerProvider.getInstance().trackEvent(GctTracking.APP_ENGINE_DEPLOY).addMetadata(GctTracking.METADATA_LABEL_KEY, isFlexCompat ? "flex-compat" : "standard").ping();
    Path stagingDirectory;
    AppEngineHelper helper = deploy.getHelper();
    try {
        stagingDirectory = helper.createStagingDirectory(deploy.getLoggingHandler(), deploy.getDeploymentConfiguration().getCloudProjectName());
    } catch (IOException ioe) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.deployment.error.creating.staging.directory"));
        logger.error(ioe);
        return;
    }
    try {
        if (helper.stageCredentials(deploy.getDeploymentConfiguration().getGoogleUsername()) == null) {
            deploy.getCallback().errorOccurred(GctBundle.message("appengine.staging.credentials.error.message"));
            return;
        }
        stageStandard.stage(stagingDirectory, startListener, deploy(stagingDirectory, startListener));
    } catch (AppEngineJavaComponentsNotInstalledException ex) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.cloudsdk.java.components.missing") + "\n" + GctBundle.message("appengine.cloudsdk.java.components.howtoinstall"));
        logger.warn(ex);
    } catch (RuntimeException re) {
        deploy.getCallback().errorOccurred(GctBundle.message("appengine.deployment.exception.during.staging") + "\n" + GctBundle.message("appengine.action.error.update.message"));
        logger.error(re);
    }
}
Also used : Path(java.nio.file.Path) AppEngineJavaComponentsNotInstalledException(com.google.cloud.tools.appengine.cloudsdk.AppEngineJavaComponentsNotInstalledException) AppEngineHelper(com.google.cloud.tools.intellij.appengine.cloud.AppEngineHelper) IOException(java.io.IOException)

Aggregations

AppEngineHelper (com.google.cloud.tools.intellij.appengine.cloud.AppEngineHelper)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 AppEngineJavaComponentsNotInstalledException (com.google.cloud.tools.appengine.cloudsdk.AppEngineJavaComponentsNotInstalledException)1