pm2+ not showing versioning when using ecosystem file

Viewed 230

I'm using PM2+ to manage my NodeJS deployments.

Usually, when I deploy an application with pm2 start src/app.js, I get details about versioning like in the screenshot below. However, when I deploy using an ecosystem file I only get N/A:

PM2+ Dashboard Screenshot

PM2 normally extracts this information directly using vizion.

But since it didn't work with the ecosystem file, I specified the GitHub repository directly just like the documentation stated.
This is my current pm2-services.json ecosystem-file:

{
    "apps": [
        {
            "name": "my-node-app",
            "cwd": "./my-node-app-repo-folder",
            "script": "src/app.js",
            "env": { 
                "NODE_ENV": "production"
            },
            "repo": "https://github.com/MyUserName/MyNodeAppRepo.git",
            "ref": "origin/master"
        }
    ]
}

For the ref field, I also tried putting refs/remotes/origin/master, remotes/origin/master and master.
Sadly none of them worked (I made sure they are correct using git show-ref).

Additional info:

  • NodeJS Version: v15.11.0
  • NPM Version: 7.6.3
  • PM2 Version: 4.5.6 (latest, by the time of writing this)

So, how do I get the Versioning field to display correctly?


Note: This isn't really an issue but rather a minor inconvenience. I just want to know what I'm doing wrong.

0 Answers
Related