Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow envBranch to be passed in on CI #2281

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

aswamy
Copy link
Contributor

@aswamy aswamy commented Jul 2, 2024

WHY are these changes introduced?

Part of #2267

WHAT is this pull request doing?

  • We currently don't parse envBranch and env flags on npx shopify hydrogen deploy command in CI environments
    • Assumption: the original intention was that CI environments would ALWAYS just pick up the branch it is on
    • If you pass in an envBranch that doesn't exist in CI, we push the deploy to preview (as before)

Future task

  • env flag will require more effort as it needs to be available on our dependant services
  • the current fix only patches it for the envBranch flag

HOW to test your changes?

  • Create a hydrogen repo
    • create a branch "fake-branch" and check it out
  • Clone this repo and checkout the branch. Run the following
    • npm ci
    • npm run build
    • CI=1 npx shopify hydrogen deploy --env-branch=main --token=<token> --force

Expected:

  • On Admin, the deployment should be created under the "Production" environment since you specified the main branch

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

Copy link
Contributor

shopify bot commented Jul 2, 2024

Oxygen deployed a preview of your allow-env-branch-on-ci branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM
optimistic-cart-ui ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM
classic-remix ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment July 2, 2024 6:58 PM

Learn more about Hydrogen's GitHub integration.

@aswamy aswamy marked this pull request as ready for review July 2, 2024 18:13
@aswamy aswamy requested review from graygilmore, benwolfram and a team July 2, 2024 18:14
packages/cli/src/commands/hydrogen/deploy.ts Outdated Show resolved Hide resolved
@aswamy aswamy merged commit 710625c into main Jul 2, 2024
13 checks passed
@aswamy aswamy deleted the allow-env-branch-on-ci branch July 2, 2024 19:48
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.

None yet

3 participants