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

What exactly does get pushed? #19

Open
intelligence opened this issue Feb 11, 2015 · 16 comments
Open

What exactly does get pushed? #19

intelligence opened this issue Feb 11, 2015 · 16 comments
Assignees
Labels

Comments

@intelligence
Copy link

I just setup capistrano-wpcli to push from local to stage.

Staging.rb

set :stage, :staging
server 'project.labs.domain.com', user: 'deploy', roles: %w{web app db}

fetch(:default_env).merge!(wp_env: :staging)

set :wpcli_remote_url, 'http://project.labs.domain.com/'
set :wpcli_local_url, 'http://project.dev/'
set :wpcli_args, 'staging'

When I push to stage I get no error messages

INFO[7386ee4b] Running /usr/bin/env wp db export - | gzip > /tmp/wpcli_database.sql.gz on localhost
INFO[7386ee4b] Finished in 0.008 seconds with exit status 0 (successful).
INFOUploading /tmp/wpcli_database.sql.gz 100.0%
INFO[4aad959f] Running /usr/bin/env gunzip < /tmp/wpcli_database.sql.gz | wp db import - on project.labs.domain.com
INFO[4aad959f] Finished in 0.153 seconds with exit status 0 (successful).
INFO[20c0aa98] Running /usr/bin/env rm /tmp/wpcli_database.sql.gz on project.labs.domain.com
INFO[20c0aa98] Finished in 0.056 seconds with exit status 0 (successful).
INFO[ba98b0a6] Running /usr/bin/env wp search-replace http://project.dev/ http://project.labs.domain.com/ staging on project.labs.domain.com
INFO[ba98b0a6] Finished in 0.785 seconds with exit status 0 (successful).
INFO[7b41a576] Running /usr/bin/env rm /tmp/wpcli_database.sql.gz on localhost
INFO[7b41a576] Finished in 0.006 seconds with exit status 0 (successful).

But if I check the staging site I cannot see any changes? The pages + settings on my local environment does not appear on the stage . What exactly should get pushed?

Could you please provide an example on how to set up the upload settings, what sort of path should be provided?

@Shaked
Copy link

Shaked commented Feb 27, 2015

+1 @intelligence

@bsadecki
Copy link

+1 @intelligence - Same here. I feel like I'm missing a big piece of the puzzle here.

@jeremyzahner
Copy link
Collaborator

Hey Guys.

I will respond on this one shortly.

Cheers

@jeremyzahner jeremyzahner self-assigned this Sep 22, 2015
@cibulka
Copy link

cibulka commented Sep 24, 2015

Same here. :) Should I import the database to my PHPMyAdmin (or something alike) manually?

@jeremyzahner
Copy link
Collaborator

Okay all.

Could you try doing it without setting the http:// in front of the url and leave out the args.

So just

set :wpcli_remote_url, 'project.labs.domain.com' 
set :wpcli_local_url, 'project.dev' 

Maybe it has to do with the search and replace operation.

@jeremyzahner
Copy link
Collaborator

And: can you provide me with the whole output of the log please?

@jeremyzahner
Copy link
Collaborator

Also try it without the trailing slash!

@davestevens
Copy link
Contributor

I faced a similar issue today where nothing was being pushed, it was due to the machine not having mysqldump installed. Technically nothing got pushed so the import didn't overwrite anything. I would suggest changing the capistrano log level to info to see more information about what it being pushed.

@davestevens
Copy link
Contributor

Just had someone else with the same issue, notice the error only being displayed as a debug message.

INFO [9ff0116e] Running /usr/bin/env wp db export - | gzip > /tmp/wpcli_database.sql.gz as Christian@localhost
DEBUG [9ff0116e] Command: ( WP_ENV=staging /usr/bin/env wp db export - | gzip > /tmp/wpcli_database.sql.gz )
DEBUG [9ff0116e]    sh: mysqldump: command not found
INFO [9ff0116e] Finished in 0.293 seconds with exit status 0 (successful).

@christianmagill
Copy link

I'm having the same issue only everything shows as successful with log level info. Still no change to staging db.

$ bundle exec cap staging wpcli:db:push                                                                                                                                                                                     [17:07:51]
INFO[f6a2cdda] Running /usr/bin/env wp db export - | gzip > /tmp/wpcli_database.sql.gz on localhost
INFO[f6a2cdda] Finished in 0.110 seconds with exit status 0 (successful).
/Users/christianmagill/.rvm/gems/ruby-2.3.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/Users/christianmagill/.rvm/gems/ruby-2.3.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:84:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
INFOUploading /tmp/wpcli_database.sql.gz 100.0%
INFO[7af53ac8] Running /usr/bin/env gunzip < /home/influe01/capistrano_tmp/wpcli_database.sql.gz | wp db import - on us17.siteground.us
INFO[7af53ac8] Finished in 0.334 seconds with exit status 0 (successful).
INFO[b596ffd6] Running /usr/bin/env rm /home/influe01/capistrano_tmp/wpcli_database.sql.gz on us17.siteground.us
INFO[b596ffd6] Finished in 0.141 seconds with exit status 0 (successful).
INFO[0661e08c] Running /usr/bin/env wp search-replace influencebydesign.dev staging.influencebydesign.com --skip-columns=guid on us17.siteground.us
INFO[0661e08c] Finished in 0.610 seconds with exit status 0 (successful).
INFO[ad2ea563] Running /usr/bin/env rm /tmp/wpcli_database.sql.gz on localhost
INFO[ad2ea563] Finished in 0.005 seconds with exit status 0 (successful).

@davestevens
Copy link
Contributor

See my previous comment, in that case it seemed that the missing mysqldump wasn't being picked up as an error or suggesting any issues with info level logging.

Try running /usr/bin/env wp db export - standalone and see if that throws any errors.

@christianmagill
Copy link

Mysqldump is available both locally and on the server. When I run "wp db export" everything works as intended.

@davestevens
Copy link
Contributor

Are you able to check the database on the staging server to see if the updated data is being transmitted at all? I've had issues previously with php-fpm having to be restarted before changes are being seen.

Is this something which was previously working and has now stopped or has it never worked? Have you tried with debug level logging to see if that points anything out?

@christianmagill
Copy link

Ah, it looks like gunzip is not available on the server.

@christianmagill
Copy link

My hosting company has recommended using gzip -d which is equivalent. @davestevens Any suggestions on how to best implement this change?

@davestevens
Copy link
Contributor

davestevens commented Dec 28, 2016

I'm not entirely sure. You are able to use SSHKit.config.command_map to change commands but there is an issue of arguments here too.

Maybe you could setup an alias on the staging server of alias gzip-decompress="gzip -d" and then add SSHKit.config.command_map[:gunzip] = 'gzip-decompress' to your deploy/staging.rb file.

Edit:
Actually, just reading, gunzip is technically a gzip with decompression. So you could possibly just use SSHKit.config.command_map[:gunzip] = 'gzip -d'.

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

No branches or pull requests

7 participants