performLaunch static method
Future<void>
performLaunch(
- Client cloudApiClient,
- FileUploaderFactory fileUploaderFactory,
- CommandLogger logger,
- String baseCommand,
- ProjectLaunch projectSetup, {
- required String consoleServer,
- required bool openBrowser,
- required int deployConcurrency,
- required bool wetRun,
- required bool deployShowFiles,
- String? deployOutputPath,
- bool deploySkipTailingStatus = false,
- IOSink? stdout,
- IOSink? stderr,
Implementation
static Future<void> performLaunch(
Client cloudApiClient,
FileUploaderFactory fileUploaderFactory,
CommandLogger logger,
String baseCommand,
ProjectLaunch projectSetup, {
required String consoleServer,
required bool openBrowser,
required int deployConcurrency,
required bool wetRun,
required bool deployShowFiles,
String? deployOutputPath,
bool deploySkipTailingStatus = false,
IOSink? stdout,
IOSink? stderr,
}) async {
final projectId = projectSetup.projectId;
if (projectId == null) {
throw StateError('Project ID not set in project setup.');
}
final projectDir = projectSetup.projectDir;
final configFilePath = projectSetup.configFilePath;
final performDeploy = projectSetup.performDeploy;
await logger.progress(
'Writing cloud configuration files',
successMessage: 'Configuration files written.',
padRight: StatusCommands.progressMessagePadLength,
() async {
await ProjectCommands.linkProject(
cloudApiClient,
projectId: projectId,
projectDirectory: projectDir.path,
configFilePath: configFilePath,
dartVersionOverride: projectSetup.dartVersionOverride,
preDeployScripts: projectSetup.suggestedPreDeployScripts,
);
return true;
},
);
await _populateCustomPasswords(
cloudApiClient,
logger,
projectId: projectId,
passwords: projectSetup.selectedPasswords,
);
if (!performDeploy) {
logger.terminalCommand(
'$baseCommand launch',
message:
'Deployment skipped. Run this command again to deploy to the cloud:',
newParagraph: true,
);
return;
}
await Deploy.deploy(
cloudApiClient,
fileUploaderFactory,
logger: logger,
baseCommand: baseCommand,
projectId: projectId,
projectDir: projectDir.path,
projectConfigFilePath: configFilePath,
concurrency: deployConcurrency,
wetRun: wetRun,
showFiles: deployShowFiles,
outputPath: deployOutputPath,
skipTailingStatus: deploySkipTailingStatus,
suppressCommandMessages: true,
dartVersionOverride: projectSetup.dartVersionOverride,
stdout: stdout,
stderr: stderr,
);
if (wetRun) return;
_displayProjectInfo(logger: logger, actualProjectId: projectId);
logger.terminalCommand(
'$baseCommand help status',
message: 'To see how to view deployment statuses, run this command:',
newParagraph: true,
);
}