Skip to content

Commit

Permalink
Remove hidden attribute from deploy command (#1628)
Browse files Browse the repository at this point in the history
* Remove hidden attribute from deploy command

* Remove publicDeployment flag

* Fix branch type to allow null

Preview environments don't have a branch but our typing here didn't
reflect that which was resulting in a bug that will be fixed in a later
commit.

* Use Environment type instead of name

* Bump oxygen-cli dependency to 4.0.0

This enables us to use their `--defaultEnvironment` flag.

* Add preview flag

This fixes a bug where users wouldn't be able to explicitly deploy to
the Preview environment depending on which Git branch they currently had
checked out.

* Remove -e flag for --env-branch

We are looking into allowing developers to use --env in the future to
specify the handle of the Environment and we'll want to reserve `-e` for
that.

* Fix changeset typo for publicDeployment removal

Co-authored-by: Vincent Lynch <[email protected]>

---------

Co-authored-by: Vincent Lynch <[email protected]>
  • Loading branch information
graygilmore and lynchv authored Jan 24, 2024
1 parent a907199 commit 6a89758
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 122 deletions.
9 changes: 9 additions & 0 deletions .changeset/forty-bugs-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@shopify/cli-hydrogen': patch
---

Remove hidden attribute from `deploy` command

You can now deploy your Hydrogen storefront without connecting to GitHub. Run the `deploy` command from your local terminal or configure a CI/CD (e.g. Bitbucket) for continuous deployment.

Run `h2 deploy --help` to see additional features of the command.
7 changes: 7 additions & 0 deletions .changeset/proud-buckets-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@shopify/cli-hydrogen': patch
---

Add --preview flag to deploy command

You can now explicitly deploy to the Preview environment with the `--preview` flag regardless of your current Git branch. For example, you can use this flag to test your changes before deploying to production if you're working off of your `main` branch.
7 changes: 7 additions & 0 deletions .changeset/wet-mangos-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@shopify/cli-hydrogen': major
---

Remove --publicDeployment flag from deploy command

The ability to mark individual deployments as public has been deprecated. If you need deployments to be accessible by other services for the purposes of end-to-end testing you can make use of the newly added `--auth-bypass-token` flag.
140 changes: 69 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,27 @@
},
"hydrogen:deploy": {
"id": "hydrogen:deploy",
"description": "Builds and deploys a Hydrogen storefront to Oxygen.",
"strict": true,
"pluginName": "@shopify/cli-hydrogen",
"pluginAlias": "@shopify/cli-hydrogen",
"pluginType": "core",
"hidden": true,
"aliases": [],
"flags": {
"env-branch": {
"name": "env-branch",
"type": "option",
"char": "e",
"description": "Environment branch (tag) for environment to deploy to.",
"required": false,
"multiple": false
},
"preview": {
"name": "preview",
"type": "boolean",
"description": "Deploys to the Preview environment. Overrides --env-branch and Git metadata.",
"required": false,
"allowNo": false
},
"force": {
"name": "force",
"type": "boolean",
Expand Down Expand Up @@ -178,25 +184,18 @@
"description": "Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).",
"multiple": false
},
"public-deployment": {
"name": "public-deployment",
"type": "boolean",
"description": "Marks a preview deployment as publicly accessible.",
"required": false,
"allowNo": false
},
"no-json-output": {
"name": "no-json-output",
"type": "boolean",
"description": "Prevents the command from creating a JSON file containing the deployment URL (in CI environments).",
"description": "Prevents the command from creating a JSON file containing the deployment URL in CI environments.",
"required": false,
"allowNo": false
},
"token": {
"name": "token",
"type": "option",
"char": "t",
"description": "Oxygen deployment token",
"description": "Oxygen deployment token. Defaults to the linked storefront's token if available.",
"required": false,
"multiple": false
},
Expand All @@ -210,7 +209,7 @@
"metadata-url": {
"name": "metadata-url",
"type": "option",
"description": "URL that links to the deployment. Will be saved and displayed in the Shopify admin",
"hidden": true,
"required": false,
"multiple": false
},
Expand All @@ -224,7 +223,7 @@
"metadata-version": {
"name": "metadata-version",
"type": "option",
"description": "A version identifier for the deployment. Will be saved and displayed in the Shopify admin",
"hidden": true,
"required": false,
"multiple": false
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@shopify/cli-kit": "3.52.0",
"@shopify/hydrogen-codegen": "^0.1.0",
"@shopify/mini-oxygen": "^2.2.4",
"@shopify/oxygen-cli": "^3.1.5",
"@shopify/oxygen-cli": "^4.0.0",
"ansi-escapes": "^6.2.0",
"cli-truncate": "^4.0.0",
"diff": "^5.1.0",
Expand Down
Loading

0 comments on commit 6a89758

Please sign in to comment.