forked from deployphp/deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpm.php
More file actions
35 lines (27 loc) · 822 Bytes
/
Copy pathnpm.php
File metadata and controls
35 lines (27 loc) · 822 Bytes
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
<?php
/*
## Configuration
- `bin/npm` *(optional)*: set npm binary, automatically detected otherwise.
## Usage
```php
after('deploy:update_code', 'npm:install');
after('npm:install', 'npm:build');
```
*/
namespace Deployer;
set('bin/npm', function () {
return which('npm');
});
// Uses `npm ci` command. This command is similar to npm install,
// except it's meant to be used in automated environments such as
// test platforms, continuous integration, and deployment -- or
// any situation where you want to make sure you're doing a clean
// install of your dependencies.
desc('Installs npm packages');
task('npm:install', function () {
run('cd {{release_path}} && {{bin/npm}} ci');
});
desc('Runs npm build');
task('npm:build', function () {
run('cd {{release_path}} && {{bin/npm}} run build');
});