Search in sources :

Example 1 with DefaultStageStandardConfiguration

use of com.google.cloud.tools.appengine.api.deploy.DefaultStageStandardConfiguration 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)

Aggregations

DefaultStageStandardConfiguration (com.google.cloud.tools.appengine.api.deploy.DefaultStageStandardConfiguration)1 CloudSdk (com.google.cloud.tools.appengine.cloudsdk.CloudSdk)1 CloudSdkAppEngineStandardStaging (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineStandardStaging)1 ProcessOutputLineListener (com.google.cloud.tools.appengine.cloudsdk.process.ProcessOutputLineListener)1