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);
}
}
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);
}
}
Aggregations