Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Nov 23, 2020

With this patch, only targets defined in .craft.yml are accepted
in the -t flag, also fixing #136.

craft publish --help
i info craft 0.13.2
dist publish NEW-VERSION

🛫 Publish artifacts

Positionals:
  NEW-VERSION  Version to publish                            [string] [required]

Options:
  --no-input         Suppresses all user prompts      [boolean] [default: false]
  --dry-run          Dry run mode: do not perform any real actions
                                                      [boolean] [default: false]
  --target, -t       Publish to this target
              [string] [choices: "npm", "gh-pages", "gcs", "registry", "github",
            "docker[release]", "docker[latest]", "all", "none"] [default: "all"]
  --rev, -r          Source revision (git SHA or tag) to publish (if not release
                     branch head)                                       [string]
  --no-merge         Do not merge the release branch after publishing
                                                      [boolean] [default: false]
  --keep-branch      Do not remove release branch after merging it
                                                      [boolean] [default: false]
  --keep-downloads   Keep all downloaded files        [boolean] [default: false]
  --no-status-check  Do not check for build status    [boolean] [default: false]
  -v, --version      Show version number                               [boolean]
  -h, --help         Show help                                         [boolean]

With this patch, only targets defined in `.craft.yml` are accepted
in the `-t` flag, also fixing #136.

```shell
craft publish --help
i info craft 0.13.2
dist publish NEW-VERSION

� Publish artifacts

Positionals:
  NEW-VERSION  Version to publish                            [string] [required]

Options:
  --no-input         Suppresses all user prompts      [boolean] [default: false]
  --dry-run          Dry run mode: do not perform any real actions
                                                      [boolean] [default: false]
  --target, -t       Publish to this target
              [string] [choices: "npm", "gh-pages", "gcs", "registry", "github",
            "release[docker]", "latest[docker]", "all", "none"] [default: "all"]
  --rev, -r          Source revision (git SHA or tag) to publish (if not release
                     branch head)                                       [string]
  --no-merge         Do not merge the release branch after publishing
                                                      [boolean] [default: false]
  --keep-branch      Do not remove release branch after merging it
                                                      [boolean] [default: false]
  --keep-downloads   Keep all downloaded files        [boolean] [default: false]
  --no-status-check  Do not check for build status    [boolean] [default: false]
  -v, --version      Show version number                               [boolean]
  -h, --help         Show help                                         [boolean]
```
@BYK BYK requested review from HazAT, jan-auer and tonyo November 23, 2020 14:07
@BYK
Copy link
Member Author

BYK commented Nov 23, 2020

//@chadwhitacre


export function getTargetId(target: TargetConfig): string {
return target.id
? `${target.id}[${target.name}]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me personally it would be more intuitive to swap id and name, so we e.g. have docker as the generic target, and docker[release] or docker#release as more specific one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and first I thought this would be a breaking change but it won't. I'll make that change and then merge.

Thanks for the feedback!

@BYK BYK merged commit 1171ea4 into master Nov 23, 2020
@BYK BYK deleted the byk/fix/only-valid-targets branch November 23, 2020 14:30
BYK added a commit that referenced this pull request Dec 1, 2020
Fixes #141, follow up to #137 where there was a forgotten negation causing this issue.

Tests will follow in a separate PR.
BYK added a commit that referenced this pull request Dec 1, 2020
Fixes #141, follow up to #137 where there was a forgotten negation causing this issue.

Tests will follow in a separate PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants