drupal, git and sanity

of 13 /13
Drupal, git and sanity Charlie Morris Penn State University Libraries @cdmo Code4lib 2015 | Portland, Oregon

Author: charlie-morris

Post on 17-Jul-2015

406 views

Category:

Technology


2 download

Embed Size (px)

TRANSCRIPT

Page 1: Drupal, git and sanity

Drupal,  git  and  sanity  

Charlie  Morris  Penn  State  University  Libraries  

@cdmo    

Code4lib  2015  |  Portland,  Oregon  

Page 2: Drupal, git and sanity

our  scenario  

•  migraEng  into  Drupal  from  proprietary  system  •  one  big  academic  library  site  •  many  smaller  library  sites  and  sites  under  the  auspices  of  the  libraries  

•  mulEple  developers  leading  and  collaboraEng  on  projects  

•  lots  of  new    

Page 3: Drupal, git and sanity
Page 4: Drupal, git and sanity

core  +  contrib  +  custom  

hJp://farm9.staEcflickr.com/8471/8135313427_44c72f8d52_c.jpg  

Page 5: Drupal, git and sanity

some  potenEal  opEons  for  managing  drupal  projects  

•  put  all  the  things  in  the  drupal  file  tree  in  a  repo  

•  whole  file  tree  +  git  submodules  for  core  +  contrib  code  

•  create  many  repos  for  the  many  custom  modules  and  themes  in  your  drupal  file  tree  –  (and  figure  out  how  to  handle  seWngs.php,  .htaccess  and  /sites/all/libraries  modificaEons)  

 

Page 6: Drupal, git and sanity

sEll  the  problem  of  updaEng  the  database  aYer  updaEng  core  and  

contrib  

Page 7: Drupal, git and sanity

how  we  are  doing  it  

•  just  managing  all  of  our  own  code  in  one  repo  (modules,  theme,  .htaccess  mods,  libraries…)  

•  aggressive  giEgnore  for  stuff  drush  can  take  care  of  

•  use  features  and  strongarm  modules  for  storing  as  much  db  config  in  code  as  possible  

•  drush  sql-­‐sync  to  keep  dev  environments  in  sync  with  live  dbs  

Page 8: Drupal, git and sanity

a  “base  build”  or  “the  upstream”  

•  created  a  base  build  that  contains  the  common  theme,  module,  and  other  custom  code  that  drush  wouldn’t  be  used  to  manage  

Page 9: Drupal, git and sanity

the  basic  idea  

1.  clone  the  base  build  and  install  via  bash  script  

2.  new  project  gets  2  remotes:  origin  and  upstream

3.  projects  are  developed  on  origin 4.  periodic  fetching  and  merging  of  upstream  

(devs  noEfied  when  changes  occur  via  Slack)  5.  drush  adds/manages/updates  core,  contrib  

Page 10: Drupal, git and sanity

git fetch upstream git merge upstream/master (resolve  conflicts  as  needed)  

Page 11: Drupal, git and sanity

link  

Page 12: Drupal, git and sanity

end  result  (hopefully)  

•  staying  in  sync  •  least  pain  possible  for  updaEng/maintaining  •  less  Eme  on  DevOps  •  more  Eme  learning  all  the  other  new  things  •  more  Eme  building  beJer  user  experiences    

Page 13: Drupal, git and sanity

thanks!    base  build  upstream  repo  at    hJps://github.com/cdmo/psu-­‐libraries-­‐drupal      quesEons/feedback?    Charlie  Morris  Penn  State  Libraries  @cdmo