From 0ee1b24c991e4ab086a9b3ba07e97dad6691643d Mon Sep 17 00:00:00 2001 From: dpfaffenbauer Date: Fri, 3 Nov 2017 09:33:06 +0100 Subject: [PATCH] make compatible with deployer 6 --- .deployer/servers.yml | 18 ------------------ README.md | 16 +++++++++++++++- deploy.sample.php | 14 ++++++++++---- recipes/npm.php | 9 +++------ recipes/yarn.php | 9 +++------ 5 files changed, 31 insertions(+), 35 deletions(-) delete mode 100755 .deployer/servers.yml diff --git a/.deployer/servers.yml b/.deployer/servers.yml deleted file mode 100755 index 29cdcdb..0000000 --- a/.deployer/servers.yml +++ /dev/null @@ -1,18 +0,0 @@ -domain.com: - hostname: domain.com - user: name - port: 22 - branch: master # defaults to master - configFile: ~/.ssh/config - identityFile: ~/.ssh/id_rsa - forwardAgent: true - multiplexing: true - sshOptions: - UserKnownHostsFile: /dev/null - StrictHostKeyChecking: no - stage: production - roles: - - app - - db - deploy_path: ~/app - extra_param: "foo {{hostname}}" \ No newline at end of file diff --git a/README.md b/README.md index ec1523b..edeeee4 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,20 @@ composer require w-vision/pimcore-deployer Installation installs deployer as well. +Now copy following files into your root-folder: + +``` +vendor/w-vision/pimcore-deployer/deploy.sample.php -> deploy.php +``` + +Edit .deployer/servers.yml to your configuration. + ## Usage -There is a sample deployer configuration file, which shows you how to configure deployer for Pimcore. \ No newline at end of file +There is a sample deployer configuration file, which shows you how to configure deployer for Pimcore. + +### Start Deployment + +``` +vendor/bin/dep deploy +``` \ No newline at end of file diff --git a/deploy.sample.php b/deploy.sample.php index 93be245..b52bc40 100755 --- a/deploy.sample.php +++ b/deploy.sample.php @@ -3,8 +3,16 @@ namespace Deployer; require __DIR__ . '/vendor/deployer/deployer/recipe/symfony3.php'; //Comes form deployer.phar -require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipe/pimcore.php'; -require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipe/yarn.php'; +require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipes/pimcore.php'; +require __DIR__ . '/vendor/w-vision/pimcore-deployer/recipes/yarn.php'; + +host('domain.com') + ->user('username') + ->port(22) + ->set('deploy_path', '/home/home_dir') + ->identityFile('PATH_TO_SSH_KEY') + ->stage('dev') + ->set('branch', 'master'); set('repository', 'ssh://git@server:22/vendor/project.git'); // Can be done via http as well. @@ -29,8 +37,6 @@ 'var/sessions' ]); -inventory(__DIR__ . '/deployer/servers.yml'); - // If your PHP executable is installed within a non standard path, use this: /*set('bin/php', function () { return '/opt/cpanel/ea-php70/root/usr/bin/php'; diff --git a/recipes/npm.php b/recipes/npm.php index 5c1c478..d626343 100644 --- a/recipes/npm.php +++ b/recipes/npm.php @@ -3,10 +3,7 @@ namespace Deployer; set('bin/npm', function () { - if (commandExist('npm')) { - return run('which npm')->toString(); - } - return false; + return locateBinaryPath('npm'); }); task('npm:install', function () { @@ -18,8 +15,8 @@ run("cd {{release_path}} && {{bin/npm}} install"); }); task('npm:production', function() { - run('cd {{release_path}} && {{env_vars}} {{bin/npm}} run build'); + run('cd {{release_path}} && {{bin/npm}} run build'); }); task('npm:develop', function() { - run('cd {{release_path}} && {{env_vars}} {{bin/npm}} run dev'); + run('cd {{release_path}} && {{bin/npm}} run dev'); }); \ No newline at end of file diff --git a/recipes/yarn.php b/recipes/yarn.php index 907b827..f1c2b5a 100644 --- a/recipes/yarn.php +++ b/recipes/yarn.php @@ -3,16 +3,13 @@ namespace Deployer; set('bin/yarn', function () { - if (commandExist('yarn')) { - return run('which yarn')->toString(); - } - return false; + return locateBinaryPath('yarn'); }); task('deploy:yarn:install', function() { - run("cd {{release_path}} && {{env_vars}} {{bin/yarn}} install"); + run("cd {{release_path}} && {{bin/yarn}} install"); }); task('deploy:yarn:encore', function() { - run("cd {{release_path}} && {{env_vars}} {{bin/yarn}} run encore production"); + run("cd {{release_path}} && {{bin/yarn}} run encore production"); });