ソースを参照

add deploy commands

Olivier Massot 4 年 前
コミット
ba0be1a426
2 ファイル変更23 行追加1 行削除
  1. 21 1
      ecosystem.config.js
  2. 2 0
      package.json

+ 21 - 1
ecosystem.config.js

@@ -9,5 +9,25 @@ module.exports = {
       script: 'yarn',
       args: 'start'
     }
-  ]
+  ],
+
+  // Deployment Configuration
+  deploy: {
+    prod: {
+      user: 'exploitation',
+      host: [''],
+      ref: 'origin/master',
+      repo: 'git@gitlab.2iopenservice.com:opentalent/admin.git',
+      path: '/var/opentalent/git/app',
+      'post-deploy': 'yarn install && yarn build && pm2 start app'
+    },
+    preprod: {
+      user: 'exploitation',
+      host: ['preprod-v2'],
+      ref: 'origin/master',
+      repo: 'git@gitlab.2iopenservice.com:opentalent/admin.git',
+      path: '/var/opentalent/git/app',
+      'post-deploy': 'yarn install && yarn build && pm2 start app'
+    }
+  }
 }

+ 2 - 0
package.json

@@ -15,6 +15,8 @@
     "start:local": "yarn start --dotenv .env.local",
     "start:preprod": "yarn start --dotenv .env.preprod",
     "start:prod": "yarn start --dotenv .env.prod",
+    "deploy:preprod": "pm2 deploy preprod",
+    "deploy:prod": "pm2 deploy prod",
     "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
     "lint": "yarn lint:js",
     "test": "jest",