mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
1.5 KiB
1.5 KiB
Contributing
Cloning PM2 development
$ git clone https://github.com/Unitech/pm2.git
$ cd pm2
$ git checkout development
$ npm install
I recommend having a pm2 alias pointing to the development version to make it easier to use pm2 development:
$ cd pm2/
$ echo "alias pm2='`pwd`/bin/pm2'" >> ~/.bashrc
You are now able to use pm2 in dev mode:
$ pm2 update
$ pm2 ls
Project structure
.
├── bin // pm2, pmd, pm2-dev, pm2-docker are there
├── examples // examples files
├── lib // source files
├── pres // presentation files
└── test // test files
Modifying the Daemon
When you modify the Daemon (lib/Daemon.js, lib/God.js, lib/God/*, lib/Watcher.js), you must restart the pm2 Daemon by doing:
$ pm2 update
Tests
There are two tests type. Programmatic and Behavioral.
The main test command is npm test
Programmatic
Programmatic tests are runned by doing
$ bash test/pm2_programmatic_tests.sh
This test files are located in test/programmatic/*
Behavioral
Behavioral tests are runned by doing:
$ bash test/pm2_behavior_tests.sh
This test files are located in test/bash/*
File of interest
$HOME/.pm2contain all PM2 related files$HOME/.pm2/logscontain all applications logs$HOME/.pm2/pidscontain all applications pids$HOME/.pm2/pm2.logPM2 logs$HOME/.pm2/pm2.pidPM2 pid$HOME/.pm2/rpc.sockSocket file for remote commands$HOME/.pm2/pub.sockSocket file for publishable events