Monday, 1 May 2017

Deploy via PM2 from private github repo

I'm using PM2 to deploy my apps, so far it worked great, however now that I have sensitive API credentials I made my repos private and now I'm unable to deploy via PM2. I have ssh set up and can successfully connect to github via

ssh git@github.com

Here is my ecosystem.json file used for deployment (which works when in public mode):

  "deploy" : {
    "production" : {
            "key" : "../.ssh/id_rsa.pem",
      "user" : "root",
      "host" : "xxx.xxx.xxx.xx",
      "ref"  : "origin/master",
      "repo" : "git@github.com/AndreasGalster/productnews-graphql.git,
      "path" : "/var/www/production",
      "post-deploy" : "yarn install && pm2 startOrRestart ecosystem.json --env production"
    }
  }

Is it not possible to deploy a private repository? If so, how should I do it? I always get "could not read Username for 'https://github.com': No such device or address" Any ideas what I could do?



via Andreas Galster

No comments:

Post a Comment