Skip to content

Commit

Permalink
feature(eas-cli): add worker --id flag (#2552)
Browse files Browse the repository at this point in the history
* feature(eas-cli): add `worker --id` flag

* docs: add changelog entry
  • Loading branch information
byCedric committed Sep 12, 2024
1 parent a404bb3 commit 12efaf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions packages/eas-cli/src/commands/worker/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ interface DeployFlags {
json: boolean;
prod: boolean;
aliasName?: string;
deploymentIdentifier?: string;
}

interface RawDeployFlags {
'non-interactive': boolean;
json: boolean;
prod: boolean;
alias?: string;
id?: string;
}

export default class WorkerDeploy extends EasCommand {
Expand All @@ -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,
};
Expand Down Expand Up @@ -124,6 +129,7 @@ export default class WorkerDeploy extends EasCommand {
async function uploadTarballAsync(tarPath: string): Promise<any> {
const uploadUrl = await getSignedDeploymentUrlAsync(graphqlClient, exp, {
appId: projectId,
deploymentIdentifier: flags.deploymentIdentifier,
});

const { response } = await uploadAsync({
Expand Down Expand Up @@ -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(),
};
}
}
Expand Down

0 comments on commit 12efaf1

Please sign in to comment.