Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 71 forks source link

post-deploy is not working. #117

Open JJ81 opened 7 years ago

JJ81 commented 7 years ago

At forehand, i'm sorry my bad english.

After i'm searching for pm2, especially deploy part, i tried to deploy my git repo source to my remote server along with its document.

http://pm2.keymetrics.io/docs/usage/deployment/

Of course, it did work partially. Only part of deploying code from github with clone. but post-deploy script is not working.

My pm2 version is 2.2.3. Is this issue already reported or am i wrong?

Please take the code below i wrote, and anybody help me.

{
  apps : [
    {
      name      : "HC_***",
      script    : "/home/ec2-user/{***}/bin/www",
      env: {
        COMMON_VARIABLE: "true"
      },
      env_production : {
        NODE_ENV: "production"
      },
      instance : -1,
      exec_mode : "cluster"
    }
  ],
  deploy : {
    production : {
      key : "./***.pem",
      user : "**user",
      host : "ec2-***.ap-northeast-2.compute.amazonaws.com",
      ref  : "origin/develop-QA", // this is not working!!
      repo : "https://github.com/***.git",
      path : "/home/ec2-user/development",
      ssh_options : ["StrictHostKeyChecking=no", "PasswordAuthentication=no"],
      "post-deploy" : "npm install ; pm2 startOrRestart ecosystem.json --env production", // this is not working
      "pre-deploy-local" : "echo 'This is a local executed command'", // this is not working
      env  : {
        NODE_ENV: "development"
      }
    },
    development : {
      key : "***.pem",
      user : "ec2-user",
      host : "ec2-***.ap-northeast-2.compute.amazonaws.com",
      ref  : "origin/develop-QA",
      repo : "https://github.com/***.git",
      path : "/home/ec2-user/development",
      ssh_options : ["StrictHostKeyChecking=no", "PasswordAuthentication=no"],
      "post-deploy" : "npm install",
      "pre-deploy-local" : "echo 'This is a local executed command'",
      env  : {
        NODE_ENV: "development"
      }
    }
  }
}