From 12efaf12cc95d8801f3e5f23e8f5d090b5964de2 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Thu, 12 Sep 2024 12:02:47 +0100 Subject: [PATCH] feature(eas-cli): add `worker --id` flag (#2552) * feature(eas-cli): add `worker --id` flag * docs: add changelog entry --- CHANGELOG.md | 1 + packages/eas-cli/src/commands/worker/deploy.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d7f183c8..8d420e32fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This is the log of notable changes to EAS CLI and related packages. - Add `worker:alias` command to assign aliases from the CLI. ([#2548](https://github.com/expo/eas-cli/pull/2548) by [@byCedric](https://github.com/byCedric)) - Add `worker --prod` flag to deploy to production from the CLI. ([#2550](https://github.com/expo/eas-cli/pull/2550) by [@byCedric](https://github.com/byCedric)) - Add `worker --alias` flag to assign custom aliases when deploying. ([#2551](https://github.com/expo/eas-cli/pull/2551) by [@byCedric](https://github.com/byCedric))) +- Add `worker --id` flag to use a custom deployment identifier. ([#2552](https://github.com/expo/eas-cli/pull/2552) by [@byCedric](https://github.com/byCedric))) ### 🐛 Bug fixes diff --git a/packages/eas-cli/src/commands/worker/deploy.ts b/packages/eas-cli/src/commands/worker/deploy.ts index c87490f14f..eb050e06b7 100644 --- a/packages/eas-cli/src/commands/worker/deploy.ts +++ b/packages/eas-cli/src/commands/worker/deploy.ts @@ -27,6 +27,7 @@ interface DeployFlags { json: boolean; prod: boolean; aliasName?: string; + deploymentIdentifier?: string; } interface RawDeployFlags { @@ -34,6 +35,7 @@ interface RawDeployFlags { json: boolean; prod: boolean; alias?: string; + id?: string; } export default class WorkerDeploy extends EasCommand { @@ -52,6 +54,9 @@ export default class WorkerDeploy extends EasCommand { description: 'Deploy to production', default: false, }), + id: Flags.string({ + description: 'A custom deployment identifier for the new deployment', + }), // TODO(@kitten): Allow deployment identifier to be specified ...EasNonInteractiveAndJsonFlags, }; @@ -124,6 +129,7 @@ export default class WorkerDeploy extends EasCommand { async function uploadTarballAsync(tarPath: string): Promise { const uploadUrl = await getSignedDeploymentUrlAsync(graphqlClient, exp, { appId: projectId, + deploymentIdentifier: flags.deploymentIdentifier, }); const { response } = await uploadAsync({ @@ -288,6 +294,7 @@ export default class WorkerDeploy extends EasCommand { json: flags['json'], prod: !!flags.prod, aliasName: flags.alias?.trim().toLowerCase(), + deploymentIdentifier: flags.id?.trim(), }; } }