GithubHelp home page GithubHelp logo

Comments (8)

oanhnn avatar oanhnn commented on July 19, 2024

I think why not using localServer() instead of local recipe ? @42antoine @Elfet @gordalina @johnny-bit

from recipes.

antonmedv avatar antonmedv commented on July 19, 2024

Detecting composer and other bin on local machines really complicated thing to separate some common things (mac, linux, windows, ...).
So it's better to define your own paths, like set('local/composer', '/path/to')

from recipes.

oanhnn avatar oanhnn commented on July 19, 2024

This is a bug of my PR. But i want ask: What are you think about using a localServer() instead of local recipe?

I think it better, because local server has same interface with remote server.
I am always using localServer to deploy local stage.

from recipes.

abenevaut avatar abenevaut commented on July 19, 2024

Because i'm relatively new to the use of deployer...
If i correctly understood the use of localServer, it only did to deploy on the same computer/server you are executing the deployment, like you previously explained it @oanhnn.

In my case, i'm using local recipe to prepare deployment files : fresh project clone, composer install, npm/bower install and execute other stuff i could not execute on FTP server.

So i did the exact schema proposed in local recipe documentation.

// deploy.php 

env('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(env('local_release_path'), env('release_path'));
})->desc('Upload local to remote');

In this context, i tried to add the var "local:true" to my config file deploy.yml, like follow

prod:
  local: true
  host: domain.com
  user: www
  identity_file: ~
  stage: production
  deploy_path: /home/42antoine/www/demo
  password:

And i got this error, that make sense because "deploy_path" exists only on remote server.

➤ Executing task deploy:prepare
↳ on [prod]
[prod] > echo $0
[prod] < sh
[prod] < 
[prod] > if [ ! -d /home/42antoine/www/demo]; then mkdir -p /home/42antoine/www/demo; fi

Exception [Symfony\Component\Process\Exception\ProcessFailedException] on [prod] server

    The command "if [ ! -d /home/42antoine/www/demo ]; then mkdir -p /home/42antoine/www/demo; fi" failed.

Exit Code: 1(General error)

Working directory: /Users/42antoine/Projects/demo/www

Output:
================


Error Output:
================
mkdir: /home/42antoine/www/demo: Permission denied



• done on [prod]
✘ Some errors occurred!

@Elfet, I also tried to change

env('bin/composer', function () {
    return runLocally('which composer')->toString();
});

to

set('local/composer', '/usr/local/bin/composer')

Then, it seems that the "local:vendors" tries to execute the composer install in remote server by using the {{bin/composer}} variable.

 Executing task local:vendors
↳ on [prod]
[prod] > if hash composer 2>/dev/null; then echo 'true'; fi
[prod] > readlink /home/42antoine/www/demo/release
[prod] < /home/42antoine/www/demo/releases/20160414073922
[prod] < 
[prod] > cd /home/42antoine/www/demo/releases/20160414073922 && curl -sS https://getcomposer.org/installer | php

Exception [RuntimeException] on [prod] server

    X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected T_NEW in <b>-</b> on line <b>437</b><br />done on [prod]
✘ Some errors occurred!

I hope this will help you see clearer on my proposal. Feel free to contradict me if I'm wrong about using the local recipe :)

from recipes.

oanhnn avatar oanhnn commented on July 19, 2024

I'm understanding your case included 2 steps:

  1. Deploy your project to local
  2. Upload you project

Uhm, i will research about this problem.

from recipes.

oanhnn avatar oanhnn commented on July 19, 2024

@42antoine I am resolved this issue by PR #48 .
Please waiting for @deployphp/maintainer merge.

from recipes.

abenevaut avatar abenevaut commented on July 19, 2024

👍

from recipes.

johnny-bit avatar johnny-bit commented on July 19, 2024

Hello! #48 looks mighty fine indeed 👍

from recipes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.