Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion contrib/npm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

```php
after('deploy:update_code', 'npm:install');
after('npm:install', 'npm:build');
```

*/
Expand All @@ -25,5 +26,10 @@
// install of your dependencies.
desc('Installs npm packages');
task('npm:install', function () {
run("cd {{release_path}} && {{bin/npm}} ci");
run('cd {{release_path}} && {{bin/npm}} ci');
});

desc('Runs npm build');
task('npm:build', function () {
run('cd {{release_path}} && {{bin/npm}} run build');
});
8 changes: 7 additions & 1 deletion contrib/yarn.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
```php
after('deploy:update_code', 'yarn:install');
after('yarn:install', 'yarn:build');
```
*/

Expand All @@ -25,5 +26,10 @@
run('cp -R {{previous_release}}/node_modules {{release_path}}');
}
}
run("cd {{release_path}} && {{bin/yarn}}");
run('cd {{release_path}} && {{bin/yarn}}');
});

desc('Runs Yarn build');
task('yarn:build', function () {
run('cd {{release_path}} && {{bin/yarn}} build');
});
14 changes: 12 additions & 2 deletions docs/contrib/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ require 'contrib/npm.php';
## Usage
```php
after('deploy:update_code', 'npm:install');
after('npm:install', 'npm:build');
```


## Configuration
### bin/npm
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L17)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L18)

## Configuration
- `bin/npm` *(optional)*: set npm binary, automatically detected otherwise.
## Usage
```php
after('deploy:update_code', 'npm:install');
after('npm:install', 'npm:build');
```

```php title="Default value"
Expand All @@ -40,7 +42,7 @@ return which('npm');
## Tasks

### npm\:install {#npm-install}
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L27)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L28)

Installs npm packages.

Expand All @@ -51,3 +53,11 @@ any situation where you want to make sure you're doing a clean
install of your dependencies.


### npm\:build {#npm-build}
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L33)

Runs npm build.




14 changes: 12 additions & 2 deletions docs/contrib/yarn.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ require 'contrib/yarn.php';
## Usage
```php
after('deploy:update_code', 'yarn:install');
after('yarn:install', 'yarn:build');
```


## Configuration
### bin/yarn
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yarn.php#L16)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yarn.php#L17)

## Configuration
- **bin/yarn** *(optional)*: set Yarn binary, automatically detected otherwise.
## Usage
```php
after('deploy:update_code', 'yarn:install');
after('yarn:install', 'yarn:build');
```

```php title="Default value"
Expand All @@ -40,10 +42,18 @@ return which('yarn');
## Tasks

### yarn\:install {#yarn-install}
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yarn.php#L22)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yarn.php#L23)

Installs Yarn packages.

In there is a {{previous_release}}, node_modules will be copied from it before installing deps with yarn.


### yarn\:build {#yarn-build}
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yarn.php#L33)

Runs Yarn build.