serverless / dashboard-plugin

The Serverless Framework Dashboard plugin
https://www.serverless.com/dashboard/
MIT License
49 stars 31 forks source link

Handle "app" and "org" configuration at deploy time #333

Open daaru00 opened 4 years ago

daaru00 commented 4 years ago

Hello,

I noticed that I cannot use variable system interpolation for app and org configuration, for example:

org: ${env:SERVERLESS_ORG}
app: myapp-${self:custom.vendor.name}
service: 
  name: myservice

throw an error:

Serverless Error ---------------------------------------

  "app" and "org" in your serverless config can not use the variable system

Is reasonable if this plugin need to perform pre-deploy check about app and organization existence, loading credentials and so on. The main issue is I cannot reuse the same code to deploy to different application or organization, I have to hard-code this configurations inside serverless.yml (under version control in any use cases).

I'm try to setup a multi-tenant project that reuse some micro-services (a simple Serverless Framework project). The impossibility to change, at deploy-time, the application/organization configuration is blocking me to use a pipeline system and generate a lot of forked repository (with the same code but different application/organization name). Also sharing open source a repository previously deployed with this system is really tricky.

What is the recommended way to handle this type of use-cases? Even just a partial support of arguments and/or environment variables can be a good compromise (that does not require any cloud vendor authentication).

airmonitor commented 4 years ago

Good questions @daaru00 . Have a similar issue.

anurag-roy commented 4 years ago

Same issue here.

anurag-roy commented 4 years ago

I found a solution:

serverless.yml

app: yourAppName
service: yourServiceName

cli

serverless deploy --org <yourOrgName>