Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Fix npm and yarn recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongerig committed Dec 27, 2017
1 parent 8e97de7 commit 00244ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
6 changes: 3 additions & 3 deletions deploy.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

require __DIR__ . '/vendor/deployer/deployer/recipe/symfony3.php'; //Comes form deployer.phar
require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipes/pimcore.php';
require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipes/npm.php';
require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipes/yarn.php';

host('domain.com')
->user('username')
Expand Down Expand Up @@ -66,8 +66,8 @@
'deploy:writable',
'deploy:vendors',
'deploy:assets:install',
'deploy:yarn:install', //Remove if you don't use yarn
'deploy:yarn:encore', //Remove if you don't use yarn
'deploy:yarn:install', // Remove if you don't use yarn
'deploy:yarn:production', // Remove if you don't use yarn
'deploy:pimcore:migrate',
'deploy:clear_paths',
'deploy:pimcore:install-classes',
Expand Down
12 changes: 6 additions & 6 deletions recipes/npm.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
return locateBinaryPath('npm');
});

task('npm:install', function () {
task('deploy:npm:install', function () {
if (has('previous_release')) {
if (test('[ -d {{previous_release}}/node_modules ]')) {
run('cp -R {{previous_release}}/node_modules {{release_path}}');
Expand All @@ -26,10 +26,10 @@
run('cd {{release_path}} && {{bin/npm}} install');
});

task('npm:production', function() {
run('cd {{release_path}} && {{bin/npm}} run build');
task('deploy:npm:develop', function() {
run('cd {{release_path}} && {{bin/npm}} run dev');
});

task('npm:develop', function() {
run('cd {{release_path}} && {{bin/npm}} run dev');
});
task('deploy:npm:production', function() {
run('cd {{release_path}} && {{bin/npm}} run build');
});
16 changes: 13 additions & 3 deletions recipes/yarn.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@
return locateBinaryPath('yarn');
});

task('deploy:yarn:install', function() {
task('deploy:yarn:install', function () {
if (has('previous_release')) {
if (test('[ -d {{previous_release}}/node_modules ]')) {
run('cp -R {{previous_release}}/node_modules {{release_path}}');
}
}

run('cd {{release_path}} && {{bin/yarn}} install');
});

task('deploy:yarn:encore', function() {
run('cd {{release_path}} && {{bin/yarn}} run encore production');
task('deploy:yarn:develop', function() {
run('cd {{release_path}} && {{bin/yarn}} run dev');
});

task('deploy:yarn:production', function() {
run('cd {{release_path}} && {{bin/yarn}} run build');
});

0 comments on commit 00244ea

Please sign in to comment.