diff --git a/CHANGELOG.md b/CHANGELOG.md index 13152262d4..da5ef31976 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages. ### 🎉 New features +- Add `eas deploy --dry-run` flag to output tarball. ([#2761](https://github.com/expo/eas-cli/pull/2761) by [@kitten](https://github.com/kitten)) + ### 🐛 Bug fixes - Remove random branch name generation for --auto branch name non-vcs fallback. ([#2747](https://github.com/expo/eas-cli/pull/2747) by [@wschurman](https://github.com/wschurman)) diff --git a/packages/eas-cli/src/commands/worker/deploy.ts b/packages/eas-cli/src/commands/worker/deploy.ts index 0a6e47fa92..11b18c382f 100644 --- a/packages/eas-cli/src/commands/worker/deploy.ts +++ b/packages/eas-cli/src/commands/worker/deploy.ts @@ -43,6 +43,7 @@ interface DeployFlags { environment?: EnvironmentVariableEnvironment; deploymentIdentifier?: string; exportDir: string; + dryRun: boolean; } interface RawDeployFlags { @@ -53,6 +54,7 @@ interface RawDeployFlags { alias?: string; id?: string; 'export-dir': string; + 'dry-run': boolean; } interface DeployInProgressParams { @@ -90,6 +92,10 @@ export default class WorkerDeploy extends EasCommand { helpValue: 'dir', default: 'dist', }), + 'dry-run': Flags.boolean({ + description: 'Outputs a tarball of the new deployment instead of uploading it.', + default: false, + }), environment: { ...EASEnvironmentFlag.environment, description: 'Deploy with EAS Environment Variables matching the specified environment.', @@ -268,6 +274,16 @@ export default class WorkerDeploy extends EasCommand { }) ); + if (flags.dryRun) { + const DRY_RUN_OUTPUT_PATH = 'deploy.tar.gz'; + await fs.promises.copyFile(tarPath, DRY_RUN_OUTPUT_PATH); + progress.succeed('Saved deploy.tar.gz tarball'); + if (flags.json) { + printJsonOnlyOutput({ tarPath: DRY_RUN_OUTPUT_PATH }); + } + return; + } + const uploadUrl = await getSignedDeploymentUrlAsync(graphqlClient, { appId: projectId, deploymentIdentifier: flags.deploymentIdentifier, @@ -382,6 +398,7 @@ export default class WorkerDeploy extends EasCommand { aliasName: flags.alias?.trim().toLowerCase(), deploymentIdentifier: flags.id?.trim(), exportDir: flags['export-dir'], + dryRun: flags['dry-run'], }; } }