Managing shopify.app.toml and .env across multiple environments with Jenkins CI/CD And github

Hi Shopify team,

We have built a Shopify custom app using Remix and currently deploy it using Jenkins CI/CD (Docker build and run). We are not using shopify app dev or shopify app deploy in our pipeline.

Right now we are using separate Git branches for each environment:

  • dev

  • staging

  • prod

The issue we are facing is that shopify.app.toml and .env values are different for each environment, especially:

  • application_url

  • redirect URLs

  • API keys

  • other environment variables

Because of this, whenever branches are merged or updated, we get configuration conflicts in shopify.app.toml and .env.

Our questions:

  1. What is the recommended way to manage environment-specific configuration for Shopify apps on GitHub?

  2. Should we maintain multiple shopify.app.toml files (e.g., dev/staging/prod)?

  3. Or should we keep one shopify.app.toml and manage environment values through CI/CD variables?

  4. What approach is recommended when using Jenkins CI/CD instead of Shopify CLI for deployment?

We want to avoid conflicts while keeping the repository clean and following Shopify best practices.

You should either have multiple shopify.app.toml configs - e.g., shopify.app.dev.toml, shopify.app.staging.toml, etc. - and deploy with the --config argument pointing to those configs. Alternatively, you can have a script in your CI/CD that replaces placeholders with env variables in the shopify.app.toml file. Unfortunately, those files don’t support referencing env variables, so you’d need to use text replacement.

1 Like

I’m using 3 toml files and it’s quite effective.

"deploy:dev": "shopify app deploy --config shopify.app.dev.toml",
    "deploy:test": "shopify app deploy --config shopify.app.test.toml",
    "deploy:prod": "shopify app deploy --config shopify.app.prod.toml",