deployphp / recipes Goto Github PK
View Code? Open in Web Editor NEWArchived. Go to
Home Page: https://github.com/deployphp/deployer/tree/master/contrib
License: MIT License
Archived. Go to
Home Page: https://github.com/deployphp/deployer/tree/master/contrib
License: MIT License
The closuritis suffers from backward incompatible changes, see
http://php.net/manual/en/migration70.incompatible.php
"Changes to the handling of indirect variables, properties, and methods"
PHP Warning: Missing argument 1 for Deployer\{closure}() in vendor/deployer/recipes/phinx.php on line 69
PHP Warning: Missing argument 2 for Deployer\{closure}() in vendor/deployer/recipes/phinx.php on line 69
PHP Notice: Undefined variable: cmdName in vendor/deployer/recipes/phinx.php on line 72
PHP Notice: Undefined variable: conf in vendor/deployer/recipes/phinx.php on line 76
PHP Warning: Invalid argument supplied for foreach() in vendor/deployer/recipes/phinx.php on line 76
PHP Fatal error: Uncaught Error: Call to undefined function /var/www/html/daniel/releases/21/vendor/robmorgan/phinx/bin/phinx () in vendor/deployer/recipes/phinx.php:126
Stack trace:
#0 [internal function]: Deployer\{closure}()
#1 phar:///usr/local/bin/dep/src/Task/Task.php(91): call_user_func(Object(Closure))
#2 phar:///usr/local/bin/dep/src/Executor/SeriesExecutor.php(40): Deployer\Task\Task->run(Object(Deployer\Task\Context))
#3 phar:///usr/local/bin/dep/src/Console/TaskCommand.php(79): Deployer\Executor\SeriesExecutor->run(Array, Array, Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Deployer\Console\Output\OutputWatcher))
#4 phar:///usr/local/bin/dep/vendor/symfony/console/Command/Command.php(256): Deployer\Console\TaskCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///usr/local/bin/dep/vendor/symfony/console/Application.php(820): Symfony\Component\Console\Command\Command->run(Object(Symfony\C in vendor/deployer/recipes/phinx.php
given common config
$ deployer.phar init -t Common
Successfully created: deploy.php
$ composer require --dev deployer/recipes
the slack notifier throws exception:
[RuntimeException]
Configuration parameter `stages` does not exists.
Now local recipe is a copy of common recipe with replaced run
calls by runLocally
calls.
I would like to leave only one copy of those recipes β common.
To do so, in Deployer v5 was introduced task(...)->local()
api.
@johnny-bit @nickdenardis let's talk about it.
For example, to make a task local:
task('deploy:update_code')->local();
task('deploy', [
'deploy:prepare',
'deploy:release',
'deploy:update_code',
'deploy:vendors',
'deploy:symlink',
]);
But now it will not work, because localhost created inside SeriesExecutor and you can't set proper deploy_path
for it.
Maybe to solve it lets run all local tasks on first localhost if deployer->hosts? Then this will be possible:
localhost()->set('deploy_path', '/some/build/path');
Main goal to achieve easily configuration of tasks.
For example. Simple recipe there deploy process split into two phases: build and deploy:
task('build', [
'deploy:update_code',
'deploy:vendors',
'yarn:install',
'npm:build',
'deploy:clear_paths',
])->local();
task('deploy', [
'deploy:prepare',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
'cleanup',
'success'
]);
before('deploy', 'build');
But now it does not work, group tasks doesn't supports become local. (what to do if one task persists in two groups: one local, one remote?)
So, what I propose to do:
local()
task on first defined localhost()
Q | A |
---|---|
Issue Type | Question |
Looking at older versions of the Slack recipe you could set channel and custom title etc, but they seem to be removed. Am I missing something?
Hey guys,
it seems the rsync task does not recognize the server password. The script ask me everytime for the server password.
Maybe this is a bug?
Hi, is there any how-to docs? Thanks.
Q | A |
---|---|
Issue Type | Bug |
Deployer Version | N/A |
Recipes Version | master branch |
Local Machine OS | N/A |
Remote Machine OS | N/A |
The $php_errormsg global variable will be deprecated on the next PHP version (7.2). It should be replaced with error_get_last() on bugsnag recipe.
deploy.php
CONTENT
With enabled option for verbose output -vvv
.
I think concurrent builds (for example on a CI-/CD-Server) are potentially having bad side effects due to the fact that the local recipe uses a fixed path '/tmp/deployer' as local_deploy_path.
Using mktemp or another way to ensure working in a uniqe directory would make the local recipe more robust for concurrent runs.
On the other hand I am not sure yet on the main purpose or usage scenario for the local recipe.
Anyway this matter might be worth a discussion or hint inside the documentation.
I am open and interested on your opinions.
| Q
| Issue Type | Question
| Deployer Version | 6.0.3
| Recipes Version | N/A
| Local Machine OS | MacOS Sierra High
| Remote Machine OS | Ubuntu
I am trying to deploy to a machine, that worked like a charm yesterday. I don't recall changing anything, but it throws an error:
The command "/usr/bin/php /var/www/html/..../artisan --version" failed.
with Exit Code: 1 (General error)
With enabled option for verbose output -vvv
.
In Client.php line 96:
[Deployer\Exception\RuntimeException (1)]
The command "/usr/bin/php /var/www/html/projectname.com/releases/1/artisan --version" failed.
Exit Code: 1 (General error)
Host Name: projectname.com
================
Exception trace:
Deployer\Ssh\Client->run() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/functions.php:292
Deployer\run() at /Users/mac/Code/projectname/vendor/deployer/deployer/recipe/laravel.php:39
Deployer\Deployer::Deployer{closure}() at n/a:n/a
call_user_func() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Configuration/Configuration.php:87
Deployer\Configuration\Configuration->get() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/functions.php:526
Deployer\get() at /Users/mac/Code/projectname/vendor/deployer/deployer/recipe/laravel.php:124
Deployer\Deployer::Deployer{closure}() at n/a:n/a
call_user_func() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Task/Task.php:104
Deployer\Task\Task->run() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Executor/SeriesExecutor.php:63
Deployer\Executor\SeriesExecutor->run() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Console/TaskCommand.php:142
Deployer\Console\TaskCommand->execute() at /Users/mac/Code/projectname/vendor/symfony/console/Command/Command.php:252
Symfony\Component\Console\Command\Command->run() at /Users/mac/Code/projectname/vendor/symfony/console/Application.php:936
Symfony\Component\Console\Application->doRunCommand() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Console/Application.php:132
Deployer\Console\Application->doRunCommand() at /Users/mac/Code/projectname/vendor/symfony/console/Application.php:240
Symfony\Component\Console\Application->doRun() at /Users/mac/Code/projectname/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /Users/mac/Code/projectname/vendor/deployer/deployer/src/Deployer.php:324
Deployer\Deployer::run() at phar:///usr/local/bin/dep/bin/dep:119
require() at /usr/local/bin/dep:4
Thanks for any help, much appreciated!
Q | A |
---|---|
Issue Type | Question / Feature Request |
Deployer Version | 5.1.3 |
Recipes Version | 4.0.7 |
Local Machine OS | Ubuntu Linux |
Remote Machine OS | Ubuntu Linux |
The recipes version 4 does not include yarn recipe yet.
Should it release a recipes v4 with the yarn recipe or a v5 one with the yarn recipe (as the deployer v5 is already released)
deploy.php
CONTENT
With enabled option for verbose output -vvv
.
Tasks:
Hi,
I have created a task that checks if vendor folder exists to copy it to new release instead of downloading everything again. If you think that this is useful tell me and I ll do a pull request.
task('copy_vendors', function () {
$current_vendors = env('deploy_path') . '/current/vendor';
if(file_exists($current_vendors)) {
run("cp -ar $current_vendors {{release_path}}");
}
})->desc('Copy vendor folder if already exists');
Q | A |
---|---|
Issue Type | Feature Request |
Deployer Version | N/A |
Recipes Version | N/A |
Local Machine OS | N/A |
Remote Machine OS | N/A |
Rollbar's recipe would need some improvements due to their official documentation, which says:
rollbar_username
is optional param, but required in Deployer. It requires totally useless & hardcoded data for every person in the project. This should be an optional parameter in Deployer too.comment
which is also optional, but Deployer forces default value such as _{{user}}_ deploying `{{branch}}` to *{{target}}*
which is also totally useless and duplicates content in Rollbar panel. This parameter should be empty by default and optional.What do you think?
Are deployphp/recipes ready for Deployer 3.0? π π»
Phinx recipe is available in the "latest" branch.
In a legacy project we are currently migrate, we have to use the v3 of Deployer and the recipe is not available.
Is it possible to backport the Phinx recipes in the 3.x branch ?
Q | A |
---|---|
Issue Type | Question |
Deployer Version | 6+ |
Recipes Version | 6+ |
Local Machine OS | OSX |
Remote Machine OS | Vagrant/centos6 |
Currently all recipes don't have the possibility to post/send multiple requests to 3rd party libraries. This is because:
Why is that? The recipe i'm currently using is Slack and I want to post deployer messages to two channels. I can fork the recipe and allow an array value to be distributed but all other recipes don't work this way. I can refactor the recipe in my own project and allow this change but future upgrades will then be impossible.
What are your thoughts on this?
I want to report that the "bin/composer" common recipe functionality work remotely and this could be a constraint for local:vendors command execution.
I propose something like
/**
* Get composer from local system
*/
env('bin/composer', function () {
return runLocally('which composer')->toString();
});
Maybe could be useful to put it in doc or directly in local recipe. What your opinion on that ?
Hi,
I'm deploying the project from a server that contains only the deploy.php file, with the vendor folder. It does not have the entire project with its .git folder there, because it's not needed in our setup.
However, in that case, the slack recipe fails, because it reads data using git
(like branch, user, revision and so on). I'm fine with not having that information in the slack message (just "deployed to stage xyz" is fine).
Could you make that information gathering optional somehow? Thanks!
[EDIT] submitted to the wrong repo, sorry
see deployphp/deployer#641
Hi, the main deployer recipes like update_code.php are also checking if the branch option is set. Is there a reason why the option is ignored in the slack recipe? Otherwise I would like to do a PR for this. Thanks in advance π
PHP Fatal error: Call to undefined method Deployer\Server\Local::getConfiguration() in .../recipes/slack.php on line 24
"Local" server implementation does not have "configuration" property.
Hello
It seem that phinx recipe is not working anymore with deployer 4.0.
Q | A |
---|---|
Issue Type | Question |
Deployer Version | 6.0.3 |
Recipes Version | 6.0 |
Local Machine OS | OSX |
Remote Machine OS | Linux |
I installed Deployer as described here. Now I need the NPM recipe, which I installed via composer require to the project and require it in the deploy.php
deploy.php
require 'recipe/typo3.php';
require 'recipe/npm.php';
...
after('deploy:update_code', 'npm:install');
Warning: require(recipe/npm.php): failed to open stream: No such file or directory in /Users/$user/Sites/example.com/dev/deploy.php on line 5
Call Stack:
0.0007 364416 1. {main}() /usr/local/bin/dep:0
0.0140 541544 2. require('phar:///usr/local/bin/dep/bin/dep') /usr/local/bin/dep:4
0.0230 1354504 3. Deployer\Deployer::run() phar:///usr/local/bin/dep/bin/dep:119
0.0362 2341184 4. call_user_func:{phar:///usr/local/bin/dep/src/Deployer.php:319}() phar:///usr/local/bin/dep/src/Deployer.php:319
0.0362 2341184 5. Deployer\Deployer::Deployer\{closure}() phar:///usr/local/bin/dep/src/Deployer.php:319
0.0432 2351440 6. require('/Users/$user/Sites/example.com/dev/deploy.php') phar:///usr/local/bin/dep/src/Deployer.php:318
How can I get this to work?
This issue comes from #10, where rsync (as an alternative deployment method) exposes and overwrites certain tasks and even the deploy
task.
We can either allow a recipe to override tasks, which is much easier for the end-user which is just plug and play.
On the other hand, for custom deploy scripts, overriding tasks can become an issue, where end-users want a specific task but it is overridden by a recipe.
Also, it could be argued that different deployment methods (such as rsync) could be on deployer itself (rather than recipes). But this will suffer from the same issue (overriding tasks and the deploy
process)
Currently all recipes expose tasks and on the documentation say how/where they should be added to the deploy process.
This is a major discussion as it will steer the 3rd party recipes and usage of these in the deployer
project.
Comments are welcome @deployphp/maintainer @Elfet @johnny-bit
Null coalescing operator is used in 93b6fb2. This is a PHP 7 only feature ie. breaks the recipe with PHP 5.6.
$ php --version
PHP 5.6.30 (cli) (built: Jan 19 2017 22:50:24)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
$ dep deploy
PHP Parse error: syntax error, unexpected '?' in /vagrant/vendor/deployer/recipes/slack.php on line 108
the code on line https://github.com/deployphp/recipes/blob/master/newrelic.php#L34
Triggers the following error:
[ERROR] Symfony\Component\Console\Exception\InvalidArgumentException: Incorrectly nested style tag found. in
/home/muller/.config/composer/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php:87
Stack trace:
#0 /home/muller/.config/composer/vendor/symfony/console/Formatter/OutputFormatter.php(185):
Symfony\Component\Console\Formatter\OutputFormatterStyleStack->pop(Object(Symfony\Component\Console\Formatte
r\OutputFormatterStyle))
#1 /home/muller/.config/composer/vendor/symfony/console/Application.php(653):
Symfony\Component\Console\Formatter\OutputFormatter->format('<error> d'</in...')
#2 /home/muller/.config/composer/vendor/symfony/console/Application.php(127):
Symfony\Component\Console\Application->renderException(Object(RuntimeException),
Object(Symfony\Component\Console\Output\StreamOutput))
#3 /home/muller/.config/composer/vendor/deployer/deployer/src/Deployer.php(190):
Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput),
Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/muller/.config/composer/vendor/deployer/deployer/bin/dep(120): Deployer\Deployer->run()
#5 {main}
This seems triggerd by the '=>' after application_id
What about adding gitter support?
https://gitter.im/deployphp/deployer
Why is there only one way to connect to a server? It would be great, if somebody implements this feature.
Q | A |
---|---|
Issue Type | Bug |
Deployer Version | 5.1.3 |
Recipes Version | 4.0.7 |
Local Machine OS | N/A |
Remote Machine OS | N/A |
If you download the current ZIP distribution via Composer and unzip it, the rsync recipe does not reflect the current code in the repository. It's still an older version wich will not work in Deployer 5.
As #39, rsync recipe have the same problem with localServer :
PHP Fatal error: Call to undefined method Deployer\Server\Local::getConfiguration() in /root/inao/deploy/vendor/deployphp/recipes/recipes/rsync.php on line 128
Thanks
In 4.0.4 the phinx recipe has no namespace, leading to crashes. Thanks!
Q | A |
---|---|
Issue Type | Bug |
Deployer Version | 6.2 |
Recipes Version | 6.1 |
Local Machine OS | Ubuntu 17.10 |
Remote Machine OS | Debian GNU/Linux 8 (jessie) |
I'll just want to notify you that in the Discord recipe the namespace Deployer;
statement is missing. Without that it comes to this error [Error] Call to undefined function set()
. I think there was also some API changes? The callback gets called once cause of config cache for callbacks result? And the placeholders in the array doesn't got replaced.
I edited the discord file and came to the following solution. This solution fix all the above issues.
<?php
/* (c) Lucas MezΓͺncio <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer;
use Deployer\Task\Context;
use Deployer\Utility\Httpie;
set('discord_webhook', function () {
return 'https://discordapp.com/api/webhooks/{{discord_channel}}/{{discord_token}}/slack';
});
// Deploy messages
set('discord_notify_text', ':information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_');
set('discord_success_text', ':white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully');
set('discord_failure_text', ':no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_');
set('discord_type', 'discord_notify_text');
// Helpers
task('discord_send_message', function(){
Httpie::post(get('discord_webhook'))->body(['text' => get(get('discord_type'))])->send();
});
// Tasks
desc('Just notify your Discord channel with all messages, without deploying');
task('discord:test', function () {
set('discord_type', 'discord_notify_text');
invoke('discord_send_message');
set('discord_type', 'discord_success_text');
invoke('discord_send_message');
set('discord_type', 'discord_failure_text');
invoke('discord_send_message');
})
->once()
->shallow();
desc('Notify Discord');
task('discord:notify', function () {
set('discord_type', 'discord_notify_text');
invoke('discord_send_message');
})
->once()
->shallow()
->isPrivate();
desc('Notify Discord about deploy finish');
task('discord:notify:success', function () {
set('discord_type', 'discord_success_text');
invoke('discord_send_message');
})
->once()
->shallow()
->isPrivate();
desc('Notify Discord about deploy failure');
task('discord:notify:failure', function () {
set('discord_type', 'discord_failure_text');
invoke('discord_send_message');
})
->once()
->shallow()
->isPrivate();
Q | A |
---|---|
Issue Type | Feature Request |
Deployer Version | 6.0.3 |
Recipes Version | 6.0.1 |
Local Machine OS | OSX |
Remote Machine OS | Linux |
Could be possible to include a slack notification for deployment error?
I use the following config to get rid of the new style deployment messages.
set("slack", [
"token" => "xoxp-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx",
"team" => "Example",
"app" => "example",
"channel" => "#example",
"message" => "{$user_data['name']} deployed [{{app_name}}:{{branch}}] on {{stage}} at ({{host}})",
"unset_text" => false,
"attachments" => null
]);
This works up 4.0.5. However starting from 4.0.6 it fails with no_text
exception.
$ dep deploy
β Executing task test
β Executing task deploy:prepare
β Executing task deploy:lock
β Executing task deploy:release
β Executing task deploy:update_code
β Executing task deploy:shared
β Executing task deploy:writable
β Executing task deploy:vendors
β Executing task deploy:clear_paths
β Executing task deploy:symlink
β Executing task deploy:unlock
β Executing task cleanup
β Executing task success
β€ Executing task deploy:slack
β Executing task deploy:failed
[RuntimeException]
no_text
Q | A |
---|---|
Issue Type | Bug // Question |
Deployer Version | 5.x |
Local Machine OS | N/A |
Remote Machine OS | N/A |
This is likely more of a question than a bug.
With the changes in 5.x there is at least one recipe broken that I know of (rsync) ... should the master branch here be inline with the 5.x changes in deployer ?
Broken rsync is due to getServer call
It already fails on this line of code
runLocally("cd {{local_deploy_path}} && if [ -h release ]; then rm release; fi");
in the local:release
task in local.php
.
@Elfet What is the best way to support / handle parallel releases? Maybe I can come up with a PR.
What about creating recipes page on deployer.org? Which will be automatically parse this repository and what main information about all recipes (task list, parameters, env vars, doc blocks). β search of recipes?
The current newrelic.php script is written to run the git commands locally, but this will not work if you deploy your stuff on a remote server. I would prefer an autodetect, but I am not sure if this is possible.
When I deploy my project, the rsync:warmup
task seems to be wrong:
...
[preprod] > tail -n 15 .dep/releases
[preprod] < 20161201113554,1
[preprod] < 20161201123207,2
...
[preprod] > echo '20161201140430,3' >> .dep/releases
[preprod] > mkdir /path/to/releases/3
...
β€ Executing task rsync:warmup
[preprod] > rsync -rlz --delete /path/to/releases/1/ /path/to/releases/2/
It tries to rsync release 1 to release 2 instead of release 2 to release 3
I think it's because you have just change release management, no ?
Q | A |
---|---|
Issue Type | Feature Request |
Deployer Version | N/A |
Recipes Version | N/A |
Local Machine OS | N/A |
Remote Machine OS | N/A |
Telegram recipe needs fail report and documentation for this feature.
The idea around these recipes is to make tedious tasks easier, and the idea around chat integration is to notify everyone on the team when someone is doing something to production.
The 5 steps that should go into a chatroom is: Starting deploy, Successful deploy, Failed deploy, Attempting Rollback, Successful Rollback.
We've had a custom setup for notifying Hipchat for the above stages. This was a simple 22 lines of code, everything in the deploy.php file. Now, using the recipe for Hipchat, the simplest solution I could find increases that to 32 lines of code, and that excludes the part doing the notification. This is what I've ended up with:
// Hipchat
set('hipchat_token', '##########');
set('hipchat_room_id', 'RoomId');
set('hipchat_url', 'https://our.internal.hipchat.url.com/v1/rooms/message');
task('hipchat:prepare', function() {
set('hipchat_color', 'yellow');
set('hipchat_message', 'STARTING: {{user}} started deploying {{application}} from {{branch}} to {{target}}');
});
before('deploy:prepare', 'hipchat:prepare');
after('hipchat:prepare', 'hipchat:notify');
task('hipchat:success', function() {
set('hipchat_color', 'green');
set('hipchat_message', 'SUCCESS: {{user}} successfully deployed {{application}} from {{branch}} to {{target}}');
});
after('success', 'hipchat:success');
after('hipchat:success', 'hipchat:notify');
task('hipchat:fail', function() {
set('hipchat_color', 'red');
set('hipchat_message', 'FAILED: {{user}} failed to deploy {{application}} from {{branch}} to {{target}}');
});
after('deploy:failed', 'hipchat:fail');
after('hipchat:fail', 'hipchat:notify');
task('hipchat:rolling-back', function() {
set('hipchat_color', 'red');
set('hipchat_message', 'ROLLING BACK: {{user}} is rolling back {{application}} on {{target}}');
});
before('rollback', 'hipchat:rolling-back');
after('hipchat:rolling-back', 'hipchat:notify');
task('hipchat:rolled-back', function() {
set('hipchat_color', 'purple');
set('hipchat_message', 'ROLLED BACK: {{user}} successfully rolled back {{application}} on {{target}}');
});
after('rollback', 'hipchat:rolled-back');
after('hipchat:rolled-back', 'hipchat:notify');
Am I missing something, or can we work together to find a way to make this simpler?
A few ideas I had was, allowing to set env vars when calling before/after:
before('deploy:prepare', 'hipchat:notify', [
'hipchat_color' => 'green',
'hipchat_message' => 'SUCCESS: {{user}} successfully deployed {{application}} from {{branch}} to {{target}}',
]);
Another idea is to setup these 5 functions in the recipe, with maybe an env var of: set('hipchat_notify_all');
Let me know what you think, will be happy to help implement these.
If the recipes are used together with the deployer branch 4.x deployments fail with the message "Uncaught Error: Call to undefined function env()"
The background is that deployer 4.x introduces the Deployer
-namespaces in functions.php. The recipes have to be adjusted accordingly. For instance env()
should become \Deployer\env()
. Since this is not backwards compatible this should be done in a new branch.
The following example from local.php fails on the after
function with the error Call to a member function desc() on null
set('local_release_path', '/tmp/my_application');
/**
* Main task
*/
task('deploy', [
'deploy:prepare',
'deploy:release',
'local:update_code',
'local:vendors',
'deploy:symlink',
'cleanup',
])->desc('Deploy your project');
after('local:vendors', function() {
upload(get('local_release_path'), get('release_path'));
})->desc('Upload local to remote');
I think that the cachetool recipe should use env() instead of get() to load cachetool options. It is quite likely to have different fpm settings for different servers. For example: we have fpm on our staging server listening to localhost:9001 but the production server can run on a different port or use unix sockets.
I could prepare a PR - to keep the backwards compatibility the recipe would use the env() value and fallback to the get() value.
I could be wrong but it looks like recipes/newrelic.php uses runLocally to set the newrelic_deploy_revision
and newrelic_deploy_description
.
If this is the case isn't it possible that the local machine is on a completely different branch / commit than the target commit?
Q | A |
---|---|
Issue Type | Bug |
Deployer Version | ^6 |
Recipes Version | ^6 |
Local Machine OS | N/A |
Remote Machine OS | N/A |
Rsync reciple does not take ssh multiplexing into account.
Configure a multiplexing deployment with rsync recipe. Using verbose output you will be able to see that the ssh command does not use ControlPath
deploy.php
Will attempt to supply if required, just tricky to pull out atm
Will attempt to supply if required, just tricky to pull out atm
I'm not entirely sure if this should be resolved here, I've previously overwrote the rsync task to include the multiplexing options but I feel that maybe the sshArguments object pulled from the host should also have the multiplexing configuration applied to it, so potentially a bug in deployer package instead.
I'm happy to look at putting together a PR to fix this given some consensus on where the fix should be
Magic constants
__DIR__
The directory of the file. If used inside an include, the directory of the included file is returned. This is equivalent to dirname(__FILE__
). This directory name does not have a trailing slash unless it is the root directory.
https://github.com/deployphp/recipes/blob/master/configure.php#L50
__DIR__
should be replaced by getcwd()
wich returns the working directory.
The output with error message:
β€ Executing task local:update_code
β³ on [api1]
Run locally: git version
> git version 2.7.4 (Apple Git-66)
Run locally: ls /tmp/my_app/releases
> 20160915104759
20160915104759.1
Run locally: readlink /tmp/my_app/release
> /tmp/my_app/releases/20160915104759.1
Run locally: git clone -b master --recursive -q --reference /tmp/my_app/releases/20160915104759 --dissociate [email protected]:..... /tmp/my_app/releases/20160915104759.1 2>&1
> fatal: reference repository '/tmp/my_app/releases/20160915104759' is not a local repository.
Run locally: git clone -b master --recursive -q [email protected]:... /tmp/my_app/releases/20160915104759.1 2>&1
β’ done on [api1]
β³ on [api2]
Run locally: git version
> git version 2.7.4 (Apple Git-66)
Run locally: ls /tmp/my_app/releases
> 20160915104759
20160915104759.1
Run locally: readlink /tmp/my_app/release
> /tmp/my_app/releases/20160915104759.1
Run locally: git clone -b master --recursive -q --reference /tmp/my_app/releases/20160915104759 --dissociate [email protected]:... /tmp/my_app/releases/20160915104759.1 2>&1
> fatal: destination path '/tmp/my_app/releases/20160915104759.1' already exists and is not an empty directory.
Run locally: git clone -b master --recursive -q git@g.... /tmp/my_app/releases/20160915104759.1 2>&1
> fatal: destination path '/tmp/my_app/releases/20160915104759.1' already exists and is not an empty directory.
[RuntimeException]
Exception trace:
() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/src/functions.php:335
runLocally() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployphp/recipes/recipes/local.php:116
{closure}() at n/a:n/a
call_user_func() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/src/Task/Task.php:79
Deployer\Task\Task->run() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/src/Executor/SeriesExecutor.php:43
Deployer\Executor\SeriesExecutor->run() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/src/Console/TaskCommand.php:82
Deployer\Console\TaskCommand->execute() at /Users/pfroebel/Projects/Mail-Deployment/vendor/symfony/console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /Users/pfroebel/Projects/Mail-Deployment/vendor/symfony/console/Application.php:818
Symfony\Component\Console\Application->doRunCommand() at /Users/pfroebel/Projects/Mail-Deployment/vendor/symfony/console/Application.php:186
Symfony\Component\Console\Application->doRun() at /Users/pfroebel/Projects/Mail-Deployment/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/src/Deployer.php:101
Deployer\Deployer->run() at /Users/pfroebel/Projects/Mail-Deployment/vendor/deployer/deployer/bin/dep:64
deploy [-p|--parallel]
The deploy.php
<?php
require '../vendor/deployphp/recipes/recipes/local.php';
require '../vendor/deployphp/recipes/recipes/rsync.php';
require 'recipe/composer.php';
serverList('../servers.yml');
set('repository', '[email protected]:.........');
env('deploy_path', '/tmp/my_app/v2.0');
env('branch', 'master');
env('local_deploy_path', '/tmp/my_app');
env('rsync_src', function() {
$local_src = env('local_release_path');
if(is_callable($local_src)){
$local_src = $local_src();
}
return $local_src;
});
task('deploy', [
'local:prepare',
'deploy:prepare',
'local:release',
'deploy:release',
'rsync:warmup',
'local:update_code',
'local:vendors',
'rsync',
'local:symlink',
'deploy:symlink',
'cleanup',
'local:cleanup'
])->desc('Deploy your project');
And the serverlist.yml
api1:
host: server1
user: webdev
stage: production
forward_agent: yes
api2:
host: server2
user: webdev
stage: production
forward_agent: yes
What is going wrong with the setup?
Greetings Philipp
Q | A |
---|---|
Issue Type | Bug, Question, Feature Request |
Deployer Version | N/A |
Recipes Version | N/A |
Local Machine OS | N/A |
Remote Machine OS | N/A |
If you're reporting a bug, please include following information
Dunno who wrote this, but it should be fixed:
HP Notice: Undefined variable: TELEGRAM_TOKEN_HERE in /Users/ideea/Development/www/areto/tjenestetorget/tjenestetorget_v2/vendor/deployer/recipes/recipe/telegram.php on line 21
Notice: Undefined variable: TELEGRAM_TOKEN_HERE in /XXX/vendor/deployer/recipes/recipe/telegram.php on line 21
PHP Notice: Undefined variable: TELEGRAM_CHATID_HERE in /XXX/vendor/deployer/recipes/recipe/telegram.php on line 22
Notice: Undefined variable: TELEGRAM_CHATID_HERE in /XXX/vendor/deployer/recipes/recipe/telegram.php on line 22
deploy.php
CONTENT
With enabled option for verbose output -vvv
.
Hi,
I think Deployer v4 is almost ready and it will be cool if recipes will be updated for it too.
ping @deployphp/maintainer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.