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

Template instances must use the same org, app & stage properties #861

Open
gjgd opened this issue Jan 3, 2021 · 4 comments
Open

Template instances must use the same org, app & stage properties #861

gjgd opened this issue Jan 3, 2021 · 4 comments

Comments

@gjgd
Copy link
Contributor

gjgd commented Jan 3, 2021

Description

I have a multi stage setup, here is my current directory structure

➜ tree
.
├── README.md
├── dev
│   └── serverless.yml
├── package.json
└── prod
    └── serverless.yml

When I run sls deploy --config=dev/serverless.yml I get the following error:

➜ sls deploy --config=dev/serverless.yml

serverless ⚡framework

Serverless › Template instances must use the same org, app & stage properties 

  Documentation: https://github.com/serverless/components 
  Support: https://app.serverless.com/support 
  Slack: https://www.serverless.com/slack/ 

However if I remove the prod directory, or if I specify --stage=dev then the deploy command is successful

the prod and dev config seem to be interfering with each other in a weird way

@gjgd
Copy link
Contributor Author

gjgd commented Jan 3, 2021

Possibly related to #860

In both cases, using the flag --config=path-to-serverless.yml leads to weird errors

@gjgd
Copy link
Contributor Author

gjgd commented Jan 3, 2021

Temporarily solved by not using --config:

In package.json:

  "scripts": {
    "deploy:dev": "cd dev && sls deploy && cd -",
    "deploy:prod": "cd prod && sls deploy && cd -"
  }

@eahefnawy
Copy link
Member

I don't think there's a --config flag for components. Remember that the original Serverless Framework and Serverless Components are completely different systems, and different CLIs, with different interfaces. Even though they are both loaded with the same installation & binary by automatically detecting the type of your projects, they work completely differently. So if something works on the framework side, it may not always work on Components.

For complete docs on the components CLI, please refer to the components README, not the docs on the website (we're planning to move components docs there too)

@gjgd
Copy link
Contributor Author

gjgd commented Jan 4, 2021

Ah I see, I wasn't aware that the --config flag did not work with Serverless Components.

Do you think this flag could be disabled when a Serverless Component is detected or at least the CLI could log a warning about it?

Happy to work on a PR if you can point me in the general direction of where this logic lives in the codebase.

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

No branches or pull requests

2 participants