How to pass in node args during post deploy?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, nodejs
Research direction
Start with the ecosystem.config.js deploy configuration and the post-deploy command shown in the issue; trace how PM2 invokes the application and how arguments reach process.argv. Done means the requested argument is present during post-deploy startup without being applied on every startup.
Written by the indexing model from the issue text.
Description
I'm using an ecosystem.config.js file. I need to pass in an argument when starting my app but only during post deploy startup.
I know I can use
{
"apps": [
{
"name": "myApp",
"script": "./myApp.js",
"args": "--randomArgs"
}
]
}
but that passes the args on every startup.
I also tried putting the args behind -- in the post deploy string but they're not showing up in process.argv.
deploy : {
development : {
"user" : "ubuntu",
"host" : ["192.168.0.13", "192.168.0.14", "192.168.0.15"],
"ref" : "origin/master",
"repo" : "git@github.com:Username/repository.git",
"path" : "/var/www/my-repository",
"post-deploy" : "npm install && pm2 startOrRestart ecosystem.config.js --randomArgs --update-env --env development"
}
}
How can this be accomplished?
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
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.
More from Unitech/pm2
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Errors Open
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100