-
Notifications
You must be signed in to change notification settings - Fork 14
/
shipitfile.js
39 lines (34 loc) · 995 Bytes
/
shipitfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* eslint-disable import/no-extraneous-dependencies, unicorn/prefer-module */
const deploy = require('shipit-deploy');
const shared = require('shipit-shared');
module.exports = (shipit) => {
// Load shipit-deploy tasks
deploy(shipit);
shared(shipit);
shipit.task('build', () => {
shipit.remote(`cd ${shipit.releasePath} && yarn install --frozen-lockfile && yarn build`);
shipit.emit('built');
});
shipit.task('pm2', () => {
shipit.log('Launching pm2');
shipit.remote(`cd ${shipit.config.deployTo} && pm2 startOrRestart current/ecosystem.json`);
});
shipit.on('updated', () => {
shipit.start('build');
});
shipit.initConfig({
default: {
branch: 'master',
deployTo: '/var/www/storefront',
keepReleases: 3,
repositoryUrl: 'https://github.com/artwithaliens/storefront.git',
shared: {
dirs: [],
files: ['.env'],
},
},
production: {
servers: '[email protected]',
},
});
};