public override async void Publish()
{
var context = new Context
{
CredentialsPath = CredentialsStore.Default.CurrentAccountPath,
ProjectId = CredentialsStore.Default.CurrentProjectId,
AppName = GoogleCloudExtensionPackage.ApplicationName,
AppVersion = GoogleCloudExtensionPackage.ApplicationVersion,
};
var options = new NetCoreDeployment.DeploymentOptions
{
Version = Version,
Promote = Promote,
Context = context
};
var project = _publishDialog.Project;
GcpOutputWindow.Activate();
GcpOutputWindow.Clear();
GcpOutputWindow.OutputLine(String.Format(Resources.GcePublishStepStartMessage, project.Name));
_publishDialog.FinishFlow();
NetCorePublishResult result;
using (var frozen = StatusbarHelper.Freeze())
using (var animationShown = StatusbarHelper.ShowDeployAnimation())
using (var progress = StatusbarHelper.ShowProgressBar(Resources.FlexPublishProgressMessage))
using (var deployingOperation = ShellUtils.SetShellUIBusy())
{
result = await NetCoreDeployment.PublishProjectAsync(
project.FullPath,
options,
progress,
GcpOutputWindow.OutputLine);
}
if (result != null)
{
GcpOutputWindow.OutputLine(String.Format(Resources.FlexPublishSuccessMessage, project.Name));
StatusbarHelper.SetText(Resources.PublishSuccessStatusMessage);
var url = result.GetDeploymentUrl();
GcpOutputWindow.OutputLine(String.Format(Resources.PublishUrlMessage, url));
if (OpenWebsite)
{
Process.Start(url);
}
}
else
{
GcpOutputWindow.OutputLine(String.Format(Resources.FlexPublishFailedMessage, project.Name));
StatusbarHelper.SetText(Resources.PublishFailureStatusMessage);
}
}