Common ENV for several apps in a JSON declaration
Open
Nobody has claimed this yet.
T: Enhancement
T: Question
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
It would be great to have a possibility to declare ENV variables in the json file and make them common for several apps. Currentelly I'm doing it like this:
{
"apps": [
{
"name": "api",
"env": {
"API_HOST": "api.service.com",
"API_PORT": 80
}
},
{
"name": "service",
"env": {
"API_HOST": "api.service.com",
"API_PORT": 80
}
}
]
}
It would be great to be able to do something like:
{
"apps": [
{
"name": "api"
},
{
"name": "service"
}
],
"env": {
"API_HOST": "api.service.com",
"API_PORT": 80
}
}
In both apps API_HOST and API_PORT variables will be available.
Or maybe there is a way to do this with json declaration? I couldn't find anything...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named in the issue. Start by tracing how PM2 reads JSON declarations and assigns environment variables to apps; done means a top-level env declaration is available to every listed app without repeating it in each app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100