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

Backdrop Drush on Pantheon #1682

Closed
greg-1-anderson opened this issue Mar 3, 2016 · 28 comments
Closed

Backdrop Drush on Pantheon #1682

greg-1-anderson opened this issue Mar 3, 2016 · 28 comments

Comments

@greg-1-anderson
Copy link

Pantheon is now defaulting to Drush 8 for new sites, so the site-local Drush feature might work with Backdrop.

Haven't tried this myself, but the steps would be:

  1. Start a new Backdrop site
  2. Add Drush to code/drush (so the full path to the Drush executable is drush/drush/drush). Be sure to use a backdrop-compatible version.
  3. Run drush @pantheon.mybackdropsite.dev status and confirm that the Drush script is, in fact, your site-local Drush.
  4. Try clearing the cache and stuff from the dashboard.

Might work.

@serundeputy
Copy link
Member

  1. Started a new backdrop site
  2. Added drush to BACKDROP_ROOT/drush so I think the path is BACKDROP_ROOT/drush/drush
    • at first I added this by cloning drush-ops/drush
    • checking out the master branch; then composer install

that did not work.

then I tried (BACKDROP_ROOT):

  • composer require "drush/drush:dev-master"
  • and putting my global drush on master, 8.0.0-rc1, 8.0.0

but then drush was not working with my drupal 7 or backdrop site. Seems to make drupal 7 happy Have to be on 6.x?

@greg-1-anderson
Copy link
Author

If you want to put your drush folder in some other location, then copy examples/drush.wrapper to BACKDROP_ROOT, and customize it to launch your specific copy of Drush. Be sure to remove the --local, or you will kill your Pantheon Drush.

Alternatively, put your Drush executable at BACKDROP_ROOT/drush/drush/drush instead of BACKDROP_ROOT/drush/drush, and it should work.

Breaking it down:

BACKDROP_ROOT/drush is the folder that Drush will look for special Drush stuff. If you unpack (e.g. git clone + composer install) your Drush here, then your Drush folder will be at BACKDROP_ROOT/drush/drush, and your Drush executable will be at BACKDROP_ROOT/drush/drush/drush.

Note also that you'll need to run composer install on your local system, commit everything to git, and then push it up to Pantheon.

@serundeputy
Copy link
Member

@greg-1-anderson I've got a fresh install of backdrop on pantheon here: https://dashboard.pantheon.io/sites/03332ea9-3572-41eb-82ff-b7a53b52cf7a#dev/code

php is 5.5
I put the drush executable at BACKDROP_ROOT/drush/drush/drush and the backdrop drush extension is here: BACKDROP_ROOT/drush/drush/commands/backdrop.

When I run terminus --site=my-drop --env=dev drush "cc all" this is the output:

geoff@gspmbp my-drop (master) $ terminus --site=my-drop --env=dev drush "cc all"
[2016-08-21 21:05:20] [warning] Note: This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
[2016-08-21 21:05:20] [info] Running drush cc all on my-drop-dev
    cmd: 'cc all'
    site: 'my-drop'
    env: 'dev'
Drush 5.10.1 does not support Drupal . Use Drush 4 instead.              [error]

It is reporting drush 5.10.1?

Do you think we can change the drush container for backdrop pantheon instances? I know that the backdrop drush extension is working on Kalabox @pirog could you provide any insight as to the Kalabox container config you are using for drush and backdrop?

thanks for all the help.
~Geoff

@greg-1-anderson
Copy link
Author

There is a Terminus command to set the Drush version.

##NAME
    terminus site drush-version


##DESCRIPTION
    see the current version of Drush being used

##SYNOPSIS
    [--site=<site>] [--env=<environment>]

##OPTIONS
    --site=<site>
        The name of your site on Pantheon
    --env=<environment>
        The Pantheon environment to check the Drush version of. NoteLeaving this blank will check the versions on all environments.

Try Drush 8.

@serundeputy
Copy link
Member

Thanks @greg-1-anderson !

I've set the Drush version to 8

geoff@gspmbp my-drop (master) $ terminus site --site=my-drop set-drush-version --version=8
[2016-08-22 13:43:33] [info] Set live's Drush version to 8, converging bindings.'
    environment: 'live'
    version: '8'
....
[2016-08-22 13:43:49] [info] Set test's Drush version to 8, converging bindings.'
    environment: 'test'
    version: '8'
.....
[2016-08-22 13:44:10] [info] Set dev's Drush version to 8, converging bindings.'
    environment: 'dev'
    version: '8'
.....
geoff@gspmbp my-drop (master) $ terminus --site=my-drop --env=dev drush "cc all"
[2016-08-22 13:44:54] [warning] Note: This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
[2016-08-22 13:44:54] [info] Running drush cc all on my-drop-dev
    cmd: 'cc all'
    site: 'my-drop'
    env: 'dev'
Unable to load autoload.php. Run composer install to fetch dependencies and write this file (http://docs.drush.org/en/master/install-alternative/). Or if you prefer, use the drush.phar which already has depdencies included (http://docs.drush.org/en/master/install).

but it seems to not be fully installed in the pantheon environment? and thus can not pick up my local drush ... does that seem correct?

If you have any further thoughts it would be much appreciated.
thanks
~Geoff


incidentally there is a typo in the error message; PR filed against drush issue drush-ops/drush#2320 ;)

@greg-1-anderson
Copy link
Author

On Pantheon, you need to commit your vendor directory to the repository.

@serundeputy
Copy link
Member

serundeputy commented Aug 22, 2016

@greg-1-anderson you are my hero!

[2016-08-22 17:47:09] [info] Running drush cc all on my-drop-dev
    cmd: 'cc all'
    site: 'my-drop'
    env: 'dev'
Warning: Permanently added the RSA host key for IP address '[104.130.221.200]:2222' to the list of known hosts.
'all' cache was cleared.                                               [success]
geoff@gspmbp drush (master) $ terminus --site=my-drop --env=dev drush "updb"
[2016-08-22 17:47:31] [warning] Note: This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
[2016-08-22 17:47:31] [info] Running drush updb on my-drop-dev
    cmd: 'updb'
    site: 'my-drop'
    env: 'dev'
No database updates required                                           [success]
Finished performing updates.                                                [ok]

When you git clone drush, the vendor directory is in drush/drush/.gitignore, so remove that, commit to the repo, push to pantheon, and #wala;

thanks so much!

@jenlampton @quicksketch what are next steps to working with pantheon ; should we make this drush/drush/drush approach as part of the offered upstream?

Can we have backdrop listed as an option now that we have a reliable way to run updates?

thanks again @greg-1-anderson ! 😄 👍 😄

@jenlampton
Copy link
Member

jenlampton commented Aug 22, 2016

@jenlampton @quicksketch what are next steps to working with pantheon?

It sounds like we need to commit the backdrop-drush vendor directory into our upstream backdrop-pantheon repo? That's at https://github.com/backdrop-ops/backdrop-pantheon.

Can we have backdrop listed as an option now that we have a reliable way to run updates?

The holdup was the "run updates" checkbox on the Pantheon dashboard that's part of the deployment workflow. Can you check and see if that is working now too?

@greg-1-anderson
Copy link
Author

The dashboard update operation works strictly as a series of git operations, so as long as your site's upstream is set to something (e.g. backdrop-ops/backdrop-pantheon) that is appropriately updated, then it should work fine.

@serundeputy
Copy link
Member

@jenlampton I've filed a PR against the Pantheon Backdrop upstream: backdrop-ops/backdrop-pantheon#6

To get the local drush detected on my test instance on Pantheon I had to set the drush version to drush 8 terminus site --site=my-drop set-drush-version --version=8 we'd want that to be the setup out the box for Pantheon Backdrop CMS instances.

I think @greg-1-anderson has set it so that Backdrop CMS instances are running PHP 5.5 out of the box on Pantheon but it definitely needs to be >PHP 5.3 and we might consider PHP 7.

We are getting close! 😄 👍

@greg-1-anderson
Copy link
Author

Today, all new sites get php 5.5 and Drush 8. I think all new sites should get PHP 7, but there are still some Drupal 7 issues with PHP 7, so we'll probably bump up to 5.6 before we go to 7. Ultimately, all of this stuff will be controlled via pantheon.yml, so the platform defaults won't be as critical -- you'll be able to just set the values you need in your upstream.

@jenlampton
Copy link
Member

@greg-1-anderson is there any documentation on the pantheon.yml yet, or are we too soon still? I'd love to get Backdrop on PHP7 out-of-the-box, and if all we need to do is include a config file in the backdrop-pantheon upstream that would be fantastic :) Pantheon is starting to sound a lot like OpenShift :)

@greg-1-anderson
Copy link
Author

It's official:

api_version: 1
php_version: 7.0

https://pantheon.io/docs/php-versions/

@pirog
Copy link

pirog commented Aug 23, 2016

Late to the party here but here is the dockerfile for the backdrop drush container
https://github.com/RobLoach/drush-docker/blob/master/backdrop/Dockerfile

@jenlampton
Copy link
Member

jenlampton commented Sep 23, 2016

I got terminus errors when I tried to run the command terminus site --site=my-drop set-drush-version --version=8 The errors were telling me that the only way to change my drush version on pantheon was to add a pantheon.yml, so I added this:

---
api_version: 1

# Drush Version
# https://pantheon.io/docs/pantheon-yml/#drush-version
drush_version: 8

A few thoughts:

  • I was thinking we'd only have to add our commands, which made a lot more sense to me.
  • Do we really want to commit all of Drush 8 and the vendor directory into the codebase? (it is completely unchanged, other than the addition of the backdrop commands)
  • drush is huge when you include the vendor directory, and most of that stuff is for Drupal 8 and irrelevant for Backdrop users @quicksketch recommended including only the .phar instead. I haven't tried that yet.
  • Is adding drush into the codebase going to break everyone's local drush, or is that just me? It was just that version of Drush (drush 9, I think)

Full report of my testing here

@jenlampton
Copy link
Member

jenlampton commented Sep 23, 2016

I was able to get drush working for terminus, but it looks like the Pantheon UI still doesn't work. I wonder if this is because the Pantheon UI ignores the site-specific version of drush in favor of it's own flavor? I would love to hear from @greg-1-anderson or @populist on how that may actually be set up behind the scenes, and what we have to do to next get the dashboard working for backdrop sites.

@greg-1-anderson
Copy link
Author

Make sure that you are running Drush 8. In your pantheon.yml:

api_version: 1
php_version: 7.0
drush_version: 8

If you do that, then pantheonssh will call the global Drush 8, which should detect and redispatch to your site-local Drush.

@jenlampton
Copy link
Member

Yes, that is done. Its still lot working. Should I open a pantheon ticket?

On Sep 23, 2016 6:33 AM, "Greg Anderson" notifications@github.com wrote:

Make sure that you are running Drush 8. In your pantheon.yml:

api_version: 1
php_version: 7.0
drush_version: 8

If you do that, then pantheonssh will call the global Drush 8, which
should detect and redispatch to your site-local Drush.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1682 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYSR3yGTtVSpXdY2uAdBPFjn4FFlkOOks5qs9UYgaJpZM4Hn_Pk
.

@greg-1-anderson
Copy link
Author

Open a Pantheon ticket and ask Support to pass your site id over to me.

@serundeputy
Copy link
Member

@greg-1-anderson I've opened a ticket and requested they pass you the site id. I'll put it here too if it helps 03332ea9-3572-41eb-82ff-b7a53b52cf7a
there are two pending update hooks on test and one on dev.
thanks!

@greg-1-anderson
Copy link
Author

greg-1-anderson commented Sep 23, 2016

@serundeputy: This looks right to me:

$ drush @my-drop.dev status
 Backdrop version     :  1.4.4                                                  
 Site URI             :  dev-my-drop.pantheonsite.io                            
 Database driver      :  mysql                                                  
 Database hostname    :  stuff                                                   
 Database port        :  16013                                                  
 Database username    :  pantheon                                               
 Database name        :  pantheon                                               
 Backdrop bootstrap   :  Successful                                             
 PHP executable       :  /srv/bindings/ceb.../php/php 
 PHP configuration    :  /srv/bindings/ceb.../php.ini 
 PHP OS               :  Linux                                                  
 Drush script         :  /srv/bindings/ceb.../code/drush/drush/drush.php                                    
 Drush version        :  8.2-dev                                                
 Drush temp           :  /tmp                                                   
 directory                                                                      
 Drush                :  /srv/bindings/ceb.../.drush/ 
 configuration           drushrc.php /etc/drush/drush8rc.php                    
 Drush alias files    :                                                         
 Install profile      :  standard                                               
 Backdrop Settings    :  ./settings.php                                         

pantheonssh called the global Drush, which redispatched to /srv/bindings/ceb.../code/drush/drush/drush.php (Drush script).

@serundeputy
Copy link
Member

Thanks @greg-1-anderson ; I agree that drush/backdrop drush extension is being picked up by Pantheon and I can execute commands via terminus including drush updb -y, but if for example I push a commit with an update hook and check the box to run updates the updates do not run.

I don't know if the dashboard calls a specific drush that has no opportunity to swap out with the site local drush?

If you can have a look and provide any insights that would be great! thanks so much for all your help!

@jenlampton
Copy link
Member

@greg-1-anderson I can confirm the same. All dashboard activities are not working with the new drush. You can see screenshots of all the dashboard tasks I tested over at backdrop-ops/backdrop-pantheon#6 (comment). Sadly, none of them worked.

@jenlampton
Copy link
Member

I had a great chat with @greg-1-anderson at BADCamp this weekend, and he made a change internally to the Pantheon dashboard /upstream set-up that should help with this. I haven't been able to get it working on my dev site yet due to some unrelated permissions issues, but I have hope!

@klonos
Copy link
Member

klonos commented Sep 21, 2019

Do we need this open against core? ...or can we close, and take discussion over to backdrop-ops/backdrop-pantheon#6 ?

@ghost
Copy link

ghost commented Sep 27, 2019

That or the drush issue queue I think. Let's close this.

@ghost ghost closed this as completed Sep 27, 2019
@ghost ghost added the type - task label Sep 27, 2019
@greg-1-anderson
Copy link
Author

BADCamp is rolling around again if this still needs attention.

@klonos
Copy link
Member

klonos commented Sep 27, 2019

@greg-1-anderson yup. Some the gang will be there. I trust that you'll bump into each other 😄

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

No branches or pull requests

5 participants