Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with parallel deploy to same host #1271

Merged
merged 2 commits into from
Jun 21, 2017
Merged

Fix bug with parallel deploy to same host #1271

merged 2 commits into from
Jun 21, 2017

Conversation

antonmedv
Copy link
Member

Q A
Bug fix? Yes
New feature? No
BC breaks? No
Deprecations? No
Fixed tickets N/A

Now it's possible to parallel deploy with this configuration:

host('prod')
    ->hostname('45.32.112.252')
    ->set('deploy_path', '~/prod');

host('beta')
    ->hostname('45.32.112.252')
    ->set('deploy_path', '~/beta');

@never615
Copy link

support multiple hostname?

@antonmedv
Copy link
Member Author

antonmedv commented Jun 21, 2017

What do you mean?

@antonmedv antonmedv merged commit e7809dc into master Jun 21, 2017
@antonmedv antonmedv deleted the feature-label branch June 21, 2017 06:19
@never615
Copy link

Version 5.0.3
If I deploy to server with settings below,Only one hostname is deployed successfully.

host('test.domian.com')
    ->hostname('111.111.111.111','222.222.222.222)
    ->stage('test')
    ->set("branch", "develop")
    ->user("user")
    ->port("666")
    ->set('deploy_path', '~/temp/test');

@antonmedv
Copy link
Member Author

No, use opposite way)

host('111.111.111.111','222.222.222.222')
    ->stage('test')
    ->set("branch", "develop")
    ->user("user")
    ->port("666")
    ->set('deploy_path', '~/temp/test');

@never615
Copy link

@antonmedv
But stage can be only one per host.😶
And Host aliases is not suitable for me,I will run only one stage at a time and deploy to many servers.
Do I understand stage errors?
I want per host to have many stages(integration test staging production..).

@antonmedv
Copy link
Member Author

Yes, stage and only be one per host. Try to use roles. They are designed to do such thing too.

@never615
Copy link

thx

@never615
Copy link

It seems like role can be only one per host too.
run `dep -v deploy --roles test
Error:

[Error] Call to a member function roles() on array 

I will use several domains for one host to solve it.

@antonmedv
Copy link
Member Author

Please show deploy.php

@never615
Copy link

host('xx.xx.xx.xx', 'yy.yy.yy.yy')
    ->roles('production')
    ->stage('production')
    ->set("branch", "master")
    ->user("username")
    ->port("666")
    ->set('deploy_path', '~');


host('xx.xx.xx.xx', 'yy.yy.yy.yy')
    ->roles('staging')
    ->stage('staging')
    ->set("branch", "develop")
    ->user("username")
    ->port("666")
    ->set('deploy_path', '~');


host('xx.xx.xx.xx')
    ->roles('test')
    ->stage('test')
    ->set("branch", "develop")
    ->user("username")
    ->port("666")
    ->set('deploy_path', '~');

@antonmedv
Copy link
Member Author

First call to host('xx.xx.xx.xx', 'yy.yy.yy.yy') is declaration.
Second call to host('xx.xx.xx.xx', 'yy.yy.yy.yy') is getting already declared hosts.
You can't have same names for different hosts. You need something like this:

host('a')
    ->hostname('xx.xx.xx.xx')
    ->stage('production')
    ->set('deploy_path', '~');

host('b')
    ->hostname('yy.yy.yy.yy')
    ->stage('production')
    ->set('deploy_path', '~');

host('c')
    ->hostname('xx.xx.xx.xx')
    ->stage('staging')
    ->set('deploy_path', '~');

host('d')
    ->hostname('yy.yy.yy.yy')
    ->stage('staging')
    ->set('deploy_path', '~');

host('e')
    ->hostname('xx.xx.xx.xx')
    ->stage('test')
    ->set('deploy_path', '~');

@f3l1x
Copy link

f3l1x commented Jun 22, 2017

Hi. I'm using 5.0.3 and I have same problem.

It doesn't work.

test:
  hostname: IP1
  user: user1
  forwardAgent: true
  multiplexing: false
  stage: stagging
  deploy_path: "~"

production:
  hostname: IP1
  user: user2
  forwardAgent: true
  multiplexing: false
  stage: production
  deploy_path: "~"

It works:

host('test')
    ->hostname('IP1')
    ->stage('stagging')
    ->user('user1')
    ->forwardAgent(true)
    ->multiplexing(false)
    ->set('deploy_path', '~');

host('production')
    ->hostname('IP1')
    ->stage('production')
    ->user('user2')
    ->forwardAgent(true)
    ->multiplexing(false)
    ->set('deploy_path', '~');

@antonmedv
Copy link
Member Author

Fix will be soon, in 5.1.0

@antonmedv
Copy link
Member Author

Now in master

@matthew-muscat
Copy link
Contributor

@antonmedv - this change appears like it may have broken rsync process.

Will raise this shortly in another issue, once i get a chance to look over this in more detail..

Here's a quick summary..

On my system, v5.1.1 appears to attempt to connect to the host, rather than the hostname specified

production:
  hostname: IP1
  user: user1
  forwardAgent: true
  multiplexing: false
  stage: production
  deploy_path: "~/deploy"
[Symfony\Component\Process\Exception\ProcessFailedException]                                                                                                                                                  
  The command "rsync -rz --delete --exclude='.env*' --exclude='.git*' --exclude='deploy.php' --exclude='hosts.yaml' --exclude='node_modules' '/example/build/current/' 'user1@production:~/deploy/releases/20170626055543/'" failed.                                                                                                    
  Exit Code: 255(Unknown error)                                                                                                                                                                                 
  Working directory: /example                                                                                                                                         
  Output:                                                                                                                                                                                                       
  ================                                                                                                                                                                                              
  Error Output:                                                                                                                                                                                                 
  ================                                                                                                                                                                                              
  Host key verification failed.                                                                                                                                                                                 
  rsync: connection unexpectedly closed (0 bytes received so far) [sender]                                                                                                                                      
  rsync error: unexplained error (code 255) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/io.c(453) [sender=2.6.9]      

@antonmedv
Copy link
Member Author

@matthew-muscat please open an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants