victorkane / lit-drupal-lean

Distro project for DrupalPicchu2014 Drupal Lean Process Workshop
GNU General Public License v2.0
10 stars 4 forks source link

Drupal core and contrib update maintenance for milestone #29

Open victorkane opened 10 years ago

victorkane commented 10 years ago

Background

From time to time major and minor core and contrib updates may become available and a decision has to be made regarding whether or not to postpone or comply with available updates.

These days this maintenance can be done with drush:

 pm-disable (dis)      Disable one or more extensions (modules or themes).                                                                
 pm-download (dl)      Download projects from drupal.org or other sources.                                                                
 pm-enable (en)        Enable one or more extensions (modules or themes).                                                                 
 pm-info (pmi)         Show detailed info for one or more extensions (modules or themes).                                                 
 pm-list (pml)         Show a list of available extensions (modules and themes).                                                          
 pm-refresh (rf)       Refresh update status information.                                                                                 
 pm-releasenotes       Print release notes for given projects.                                                                            
 (rln)                                                                                                                                    
 pm-releases (rl)      Print release information for given projects.                                                                      
 pm-uninstall          Uninstall one or more modules.                                                                                     
 pm-update (up)        Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb). 
 pm-updatecode (upc)   Update Drupal core and contrib projects to latest recommended releases.                                            
 pm-updatestatus       Show a report of available minor updates to Drupal core and contrib projects.  

Refresh update info

lit@awebfactory:~/lit-dev/docroot$ drush pm-refresh
Refreshing update status information ...
Done.

Drush update options galore

lit@awebfactory:~/lit-dev/docroot$ drush help pm-update
Display available update information for Drupal core and all enabled projects and allow updating to latest recommended releases. Also apply any database updates required (same as
pm-updatecode + updatedb). Note: The user is asked to confirm before the actual update. Backups are performed unless directory is already under version control. Updated projects can
potentially break your site. It is NOT recommended to update production sites without prior testing.

Arguments:
 projects                                  Optional. A list of installed projects to update.

Options:
 --cache                                   Cache release XML and tarballs or git clones. Git clones use git's --reference option.                                                   
 --check-updatedb                          Check to see if an updatedb is needed after updating the code. Default is on; use --check-updatedb=0 to disable.                         
 --lock=<foo,bar>                          Add a persistent lock to remove the specified projects from consideration during updates.  Locks may be removed with the --unlock        
                                           parameter, or overridden by specifically naming the project as a parameter to pm-update or pm-updatecode.  The lock does not affect      
                                           pm-download.  See also the update_advanced project for similar and improved functionality.                                               
   --lock-message=<message>                A brief message explaining why a project is being locked; displayed during pm-updatecode.  Optional.                                     
   --unlock=<foo,bar>                      Remove the persistent lock from the specified projects so that they may be updated again.                                                
 --no-core                                 Only update modules and skip the core update.                                                                                            
 --notes                                   Show release notes for each project to be updated.                                                                                       
 --security-only                           Only update modules that have security updates available.                                                                                
 --package-handler=wget                    Download project packages using wget or curl.  
 --package-handler=git_drupalorg           Use git.drupal.org to checkout and update projects.                                                                                      
   --gitusername                           Your git username as shown on user/[uid]/edit/git. Typically, this is set this in drushrc.php. Omitting this prevents users from pushing 
                                           changes back to git.drupal.org.                                                                                                          
   --gitsubmodule                          Use git submodules for checking out new projects. Existing git checkouts are unaffected, and will continue to (not) use submodules       
                                           regardless of this setting.                                                                                                              
     --gitsubmoduleaddparams               Add options to the `git submodule add` command.                                                                                          
   --gitcheckoutparams                     Add options to the `git checkout` command.                                                                                               
   --gitcloneparams                        Add options to the `git clone` command.                                                                                                  
   --gitfetchparams                        Add options to the `git fetch` command.                                                                                                  
   --gitpullparams                         Add options to the `git pull` command.                                                                                                   
   --gitinfofile                           Inject version info into each .info file.                                                                                                
 --version-control=backup                  Backup all project files before updates.                                                                                                 
   --no-backup                             Do not perform backups.                                                                                                                  
   --backup-dir                            Specify a directory to backup projects into. Defaults to drush-backups within the home directory of the user running the command. It is  
                                           forbidden to specify a directory inside your drupal root.                                                                                
 --version-control=bzr                     Quickly add/remove/commit your project changes to Bazaar.                                                                                
   --bzrsync                               Automatically add new files to the Bazaar repository and remove deleted files. Caution.                                                  
   --bzrcommit                             Automatically commit changes to Bazaar repository. You must also use the --bzrsync option.                                               
     --bzrmessage                          Override default commit message which is: Drush automatic commit. Project <name> <type> Command: <the drush command line used>           
 --version-control=svn                     Quickly add/remove/commit your project changes to Subversion.                                                                            
   --svnsync                               Automatically add new files to the SVN repository and remove deleted files. Caution.                                                     
   --svncommit                             Automatically commit changes to SVN repository. You must also using the --svnsync option.                                                
     --svnmessage                          Override default commit message which is: Drush automatic commit: <the drush command line used>                                          
   --svnstatusparams                       Add options to the 'svn status' command                                                                                                  
   --svnaddparams                          Add options to the `svn add` command                                                                                                     
   --svnremoveparams                       Add options to the `svn remove` command                                                                                                  
   --svnrevertparams                       Add options to the `svn revert` command                                                                                                  
   --svncommitparams                       Add options to the `svn commit` command

Topics:
 docs-policy                               Example policy file.

Aliases: up
victorkane commented 10 years ago

Today we've done a straight up automated update, code and database and everything, but conserving manual confirmation of each step:

lit@awebfactory:~/lit-dev/docroot$ drush pm-refresh
Refreshing update status information ...
Done.

lit@awebfactory:~/lit-dev/docroot$ drush pm-update
 Name                                           Installed Version  Proposed version  Message          
 Date (date)                                    7.x-2.6            7.x-2.7           Update available 
 Views Bulk Operations (views_bulk_operations)  7.x-3.1            7.x-3.2           Update available 

Update information last refreshed: Wed, 12/25/2013 - 15:54
Code updates will be made to the following projects: Date [date-7.x-2.7], Views Bulk Operations (VBO) [views_bulk_operations-7.x-3.2]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project date was updated successfully. Installed version is now 7.x-2.7.
Backups were saved into the directory /home/lit/drush-backups/lit_dev01/20131225170229/modules/date.                                                                       [ok]
Project views_bulk_operations was updated successfully. Installed version is now 7.x-3.2.
Backups were saved into the directory /home/lit/drush-backups/lit_dev01/20131225170229/modules/views_bulk_operations.                                                      [ok]
No database updates required                                                                                                                                               [success]
'all' cache was cleared in self                                                                                                                                            [success]
Finished performing updates.                                                                                                                                               [ok]
lit@awebfactory:~/lit-dev/docroot$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   sites/all/modules/contrib/date/CHANGELOG.txt
#       modified:   sites/all/modules/contrib/date/LICENSE.txt
#       modified:   sites/all/modules/contrib/date/date.api.php
#       modified:   sites/all/modules/contrib/date/date.field.inc
#       modified:   sites/all/modules/contrib/date/date.info
#       modified:   sites/all/modules/contrib/date/date.module
#       modified:   sites/all/modules/contrib/date/date.theme
#       modified:   sites/all/modules/contrib/date/date_admin.inc
#       modified:   sites/all/modules/contrib/date/date_all_day/date_all_day.info
#       modified:   sites/all/modules/contrib/date/date_api/date_api.info
#       modified:   sites/all/modules/contrib/date/date_api/date_api.module
#       modified:   sites/all/modules/contrib/date/date_api/date_api_elements.inc
#       modified:   sites/all/modules/contrib/date/date_api/date_api_sql.inc
#       modified:   sites/all/modules/contrib/date/date_context/date_context.info
#       modified:   sites/all/modules/contrib/date/date_context/plugins/date_context_date_condition.inc
#       modified:   sites/all/modules/contrib/date/date_elements.inc
#       deleted:    sites/all/modules/contrib/date/date_migrate/date.migrate.inc
#       modified:   sites/all/modules/contrib/date/date_migrate/date_migrate.info
#       modified:   sites/all/modules/contrib/date/date_migrate/date_migrate.module
#       deleted:    sites/all/modules/contrib/date/date_migrate/date_migrate.test
#       modified:   sites/all/modules/contrib/date/date_migrate/date_migrate_example/date_migrate_example.info
#       modified:   sites/all/modules/contrib/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
#       modified:   sites/all/modules/contrib/date/date_migrate/date_migrate_example/date_migrate_example.module
#       modified:   sites/all/modules/contrib/date/date_popup/README.txt
#       modified:   sites/all/modules/contrib/date/date_popup/date_popup.info
#       modified:   sites/all/modules/contrib/date/date_popup/date_popup.module
#       modified:   sites/all/modules/contrib/date/date_repeat/date_repeat.info
#       modified:   sites/all/modules/contrib/date/date_repeat/date_repeat_form.inc
#       modified:   sites/all/modules/contrib/date/date_repeat_field/date_repeat_field.info
#       modified:   sites/all/modules/contrib/date/date_repeat_field/date_repeat_field.module
#       modified:   sites/all/modules/contrib/date/date_tools/date_tools.info
#       modified:   sites/all/modules/contrib/date/date_views/date_views.info
#       modified:   sites/all/modules/contrib/date/date_views/includes/date_views_argument_handler_simple.inc
#       modified:   sites/all/modules/contrib/date/date_views/includes/date_views_filter_handler.inc
#       modified:   sites/all/modules/contrib/date/date_views/includes/date_views_filter_handler_simple.inc
#       modified:   sites/all/modules/contrib/views_bulk_operations/LICENSE.txt
#       modified:   sites/all/modules/contrib/views_bulk_operations/actions/delete.action.inc
#       modified:   sites/all/modules/contrib/views_bulk_operations/actions/modify.action.inc
#       modified:   sites/all/modules/contrib/views_bulk_operations/actions_permissions.info
#       modified:   sites/all/modules/contrib/views_bulk_operations/plugins/operation_types/action.class.php
#       modified:   sites/all/modules/contrib/views_bulk_operations/plugins/operation_types/base.class.php
#       modified: sites/all/modules/contrib/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc
#       modified:   sites/all/modules/contrib/views_bulk_operations/views_bulk_operations.info
#       modified:   sites/all/modules/contrib/views_bulk_operations/views_bulk_operations.module
#       modified:   sites/all/modules/contrib/views_bulk_operations/views_bulk_operations.rules.inc
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       sites/all/modules/contrib/date/date.diff.inc
#       sites/all/modules/contrib/date/date.migrate.inc
#       sites/all/modules/contrib/date/tests/date_migrate.test
#       sites/all/modules/contrib/views_bulk_operations/actions/book.action.inc
#       sites/all/modules/contrib/views_bulk_operations/actions/user_cancel.action.inc
no changes added to commit (use "git add" and/or "git commit -a")
lit@awebfactory:~/lit-dev/docroot$ 

Important: update install profile (drush make file only, which we don't actually run right now, but...) to new versions.