All things Shopify and commerce
Attempting to try to deploy hydrogen using Azure DevOps Pipelines. When I run the deploy command, both on the CI machine and my local machine, it attempts to login to Shopify.
The command I am running both on the CI and my local CLI...
npx shopify hydrogen deploy --token ************
The results of running the command...
To run this command, log in to Shopify.
According to the Deployment CI/CD Docs, it seems like this should be the only command that is needed. How can I deploy from a CI without logging into Shopify? Is it possible to do it with just the Oxygen deployment token?
Thanks!
Solved! Go to the solution
This is an accepted solution.
So we actually figured it out. Turns out the deploy command checks if your in a continuous integration (CI) environment (like GitHub Actions) and if your not, it falls back to user login. It does this by looking at environment variables (specifically the "CI" variable) and Azure DevOps Pipelines is not one of the supported CIs nor does it set the "CI" variable. Thus, the deploy command is unable to recognize in ADO, it's inside a CI.
To fix this simply set the "CI" environment variable to something truthy.
- script: |
npx shopify hydrogen deploy --token $(SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN)
displayName: Build and Publish to Oxygen
workingDirectory: click-and-collect-storefront
env:
CI: true
This is an accepted solution.
So we actually figured it out. Turns out the deploy command checks if your in a continuous integration (CI) environment (like GitHub Actions) and if your not, it falls back to user login. It does this by looking at environment variables (specifically the "CI" variable) and Azure DevOps Pipelines is not one of the supported CIs nor does it set the "CI" variable. Thus, the deploy command is unable to recognize in ADO, it's inside a CI.
To fix this simply set the "CI" environment variable to something truthy.
- script: |
npx shopify hydrogen deploy --token $(SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN)
displayName: Build and Publish to Oxygen
workingDirectory: click-and-collect-storefront
env:
CI: true
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024