Search in sources :

Example 6 with CloudSdk

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

the class AppEngineStandardStage method stage.

/**
 * Stage the application in preparation for deployment to the App Engine standard environment.
 *
 * @param stagingDirectory the local staging directory
 * @param onStageComplete a callback for executing actions on completion of staging
 */
public void stage(@NotNull Path stagingDirectory, @NotNull ProcessStartListener startListener, @NotNull ProcessExitListener onStageComplete) {
    ProcessOutputLineListener outputListener = new ProcessOutputLineListener() {

        @Override
        public void onOutputLine(String line) {
            loggingHandler.print(line + "\n");
        }
    };
    CloudSdk sdk = helper.createSdk(loggingHandler, startListener, outputListener, outputListener, onStageComplete);
    // TODO determine the default set of flags we want to set for AE standard staging
    DefaultStageStandardConfiguration stageConfig = new DefaultStageStandardConfiguration();
    stageConfig.setEnableJarSplitting(true);
    // TODO(joaomartins): Change File to Path on library configs.
    stageConfig.setStagingDirectory(stagingDirectory.toFile());
    stageConfig.setSourceDirectory(deploymentArtifactPath.toFile());
    CloudSdkAppEngineStandardStaging staging = new CloudSdkAppEngineStandardStaging(sdk);
    staging.stageStandard(stageConfig);
}
Also used : DefaultStageStandardConfiguration(com.google.cloud.tools.appengine.api.deploy.DefaultStageStandardConfiguration) ProcessOutputLineListener(com.google.cloud.tools.appengine.cloudsdk.process.ProcessOutputLineListener) CloudSdkAppEngineStandardStaging(com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineStandardStaging) CloudSdk(com.google.cloud.tools.appengine.cloudsdk.CloudSdk)

Example 7 with CloudSdk

use of com.google.cloud.tools.appengine.cloudsdk.CloudSdk in project app-maven-plugin by GoogleCloudPlatform.

the class AbstractMojoIntegrationTest method deleteService.

protected void deleteService(String service) throws ProcessRunnerException, CloudSdkNotFoundException, CloudSdkOutOfDateException, CloudSdkVersionFileException, InvalidJavaSdkException {
    CloudSdk cloudSdk = new CloudSdk.Builder().exitListener(new NonZeroExceptionExitListener()).build();
    cloudSdk.runAppCommand(Arrays.asList("services", "delete", service));
}
Also used : NonZeroExceptionExitListener(com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitListener) CloudSdk(com.google.cloud.tools.appengine.cloudsdk.CloudSdk)

Aggregations

CloudSdk (com.google.cloud.tools.appengine.cloudsdk.CloudSdk)7 AppEngineException (com.google.cloud.tools.appengine.api.AppEngineException)2 ProcessExitListener (com.google.cloud.tools.appengine.cloudsdk.process.ProcessExitListener)2 ProcessOutputLineListener (com.google.cloud.tools.appengine.cloudsdk.process.ProcessOutputLineListener)2 VisibleForTesting (com.google.api.client.repackaged.com.google.common.annotations.VisibleForTesting)1 DefaultDeployConfiguration (com.google.cloud.tools.appengine.api.deploy.DefaultDeployConfiguration)1 DefaultStageStandardConfiguration (com.google.cloud.tools.appengine.api.deploy.DefaultStageStandardConfiguration)1 DefaultVersionsSelectionConfiguration (com.google.cloud.tools.appengine.api.versions.DefaultVersionsSelectionConfiguration)1 AppEngineJavaComponentsNotInstalledException (com.google.cloud.tools.appengine.cloudsdk.AppEngineJavaComponentsNotInstalledException)1 CloudSdkAppEngineDeployment (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDeployment)1 CloudSdkAppEngineStandardStaging (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineStandardStaging)1 CloudSdkAppEngineVersions (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineVersions)1 CloudSdkAuth (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAuth)1 CloudSdkNotFoundException (com.google.cloud.tools.appengine.cloudsdk.CloudSdkNotFoundException)1 CloudSdkOutOfDateException (com.google.cloud.tools.appengine.cloudsdk.CloudSdkOutOfDateException)1 NonZeroExceptionExitListener (com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitListener)1 ProcessStartListener (com.google.cloud.tools.appengine.cloudsdk.process.ProcessStartListener)1 AppEngineFlexibleFacet (com.google.cloud.tools.intellij.appengine.facet.flexible.AppEngineFlexibleFacet)1 FlexibleFacetEditor (com.google.cloud.tools.intellij.appengine.facet.flexible.FlexibleFacetEditor)1 CloudSdkVersionNotifier (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkVersionNotifier)1