Plans for running from drush

Created on 5 July 2024, 6 months ago
Updated 13 August 2024, 4 months ago

Problem/Motivation

I only found out about this initiative and it's great.

I managed to create a block_content entity with very little effort.

I wonder are there any plans to move to drush for running the recipe command instead of core/scripts/drupal?

This would allow running in production environments where ssh is not available and users want to deploy content.

Or is there a better way of doing this, like calling exec in a post_deploy file?

Apologies if this has come up before and grateful for any pointers

πŸ’¬ Support request
Status

Fixed

Version

11.0

Component

Code

Created by

miiimooo Europe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @miiimooo
  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Drush 13 will have a recipe command:

    https://github.com/drush-ops/drush/pull/5997

    and will allow for drush site:install to install from a recipe.

    https://github.com/drush-ops/drush/pull/6026

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    On Pantheon, you can also run the PHP command using terminus.

    terminus drush site.env -- ev "passthru('php core/scripts/drupal recipe path/to/recipe');"

  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts
  • Status changed to Active 5 months ago
  • miiimooo Europe

    Thanks for the support.

    I tried this, the output is just

    Headers: {"User-Agent":"Terminus/3.1.4 (php_version=8.1.2-1ubuntu2.18&script=XXX/terminus)","Accept":"application/json","Authorization":"**HIDDEN**"}
    URI: https://terminus.pantheon.io:443/api/sites/XXX/environments
    Method: GET
    Body: null
     [warning] 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.
     [notice] Command: site.env -- drush ev passthru('php core/scripts/drupal recipe modules/custom/mymodule/recipes/testing -v'); [Exit: 0]
    

    The recipe should create a block_content entity, but nothing happens and no log message either

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Did you replace site.env with your actual site name and environment?

    What version of Drupal are you running?

  • miiimooo Europe

    I used the correct site.env just obfuscated here:

    terminus -v drush site.env  -- st
    ...
    Drupal version   : 10.3.0                                
    Site URI         : http://XXX.pantheonsite.io 
    DB driver        : mysql                                 
    DB hostname      : dbhost                                
    DB port          : 6033                                  
    DB username      : XXX      
    DB name          : pantheon                              
    Database         : Connected                             
    Drupal bootstrap : Successful                            
    Default theme    : XXX                            
    Admin theme      : XXX                                 
    PHP binary       : /opt/pantheon/php8.3/php              
    PHP OS           : Linux                                 
    PHP version      : 8.3.9                                 
    ...
    
  • Status changed to RTBC 5 months ago
  • miiimooo Europe

    This worked now. It could have been an issue with the path to the recipe. I used:

    terminus drush SITE.ENV -- ev "passthru('php core/scripts/drupal recipe modules/custom/MY_MODULE/recipes/follow/');"
    

    In my repository the recipe.yml is located in

    web/modules/custom/MY_MODULE/recipes/follow
    

    Thank you.

  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024