Advertisement
bairui

bzr workflow

Aug 19th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. Website Development And Migration Workflow
  2. ==========================================
  3. Barry Arthur_and_Belinda Allan
  4. v1.1, August 19, 2011
  5.  
  6. Website Repository Layout
  7. -------------------------
  8.  
  9. .Repositories for website projects are:
  10. bzr+ssh://todd/mnt/repos/websites/<project>
  11.  
  12. ---------------------------------------
  13. /mnt/repos/websites/
  14. *<project>*
  15. &trunk&
  16. xpt%
  17. 1.0(t)
  18. 1.1.0(t)
  19. 2.0(t)
  20. dev/
  21. 1.x/
  22. feature-1f%
  23. feature-2f%
  24. bug-1b%
  25. 2.x/
  26. bug-2b%
  27. feature-3f%
  28. ---------------------------------------
  29.  
  30. Setup
  31. -----
  32.  
  33. .Create Project Repository on todd
  34.  
  35. ---------------------------------------
  36. cd /mnt/repos
  37. bzr init-repo --no-trees <project>
  38. bzr init <project>/trunk
  39. ---------------------------------------
  40.  
  41. .Initialize Working Area
  42.  
  43. ---------------------------------------
  44. cd ~/websites/
  45. bzr init-repo <project>
  46. cd <project>
  47. ---------------------------------------
  48.  
  49. Feature / Bug Workflow
  50. ----------------------
  51.  
  52. ---------------------------------------
  53. cd ~/websites/<project>
  54. bzr branch bzr+ssh://todd/mnt/repos/<project>/trunk \
  55. bzr+ssh://todd/mnt/repos/<project>/dev/1.x/<feature-1f>
  56. bzr checkout bzr+ssh://todd/mnt/repos/<project>/dev/1.x/<feature-1f>
  57. ---------------------------------------
  58.  
  59. <hack, hack, hack>
  60.  
  61. ---------------------------------------
  62. bzr commit -m "commit message"
  63. bzr up <--for latest changes from others
  64. ---------------------------------------
  65. If a longer development cycle/time, implement trunk importing/pulling
  66. steps below.
  67.  
  68. .Update your Feature work with trunk changes
  69.  
  70. Create local trunk branch if not exists.
  71.  
  72. ---------------------------------------
  73. bzr branch bzr+ssh://todd/mnt/repos/<project>/trunk
  74. ---------------------------------------
  75.  
  76. Otherwise:
  77.  
  78. ---------------------------------------
  79. cd trunk
  80. bzr merge --pull --remember bzr+ssh://todd/mnt/repos/<project>/trunk
  81. cd ../<feature-1f>
  82. bzr merge ../trunk
  83. bzr commit -m "commit message"
  84. ---------------------------------------
  85.  
  86. Migrate to trunk
  87. ----------------
  88.  
  89. Create trunk & feature branches if necessary:
  90.  
  91. ---------------------------------------
  92. cd ~/websites/<project>
  93. bzr branch bzr+ssh://todd/mnt/repos/<project>/trunk
  94. bzr branch bzr+ssh://todd/mnt/repos/<project>/dev/1.x/<feature-1f>
  95. ---------------------------------------
  96.  
  97. Then merge:
  98.  
  99. ---------------------------------------
  100. cd trunk
  101. bzr merge ../<feature-1f>
  102. ---------------------------------------
  103.  
  104. <fix conflicts; test>
  105.  
  106. ---------------------------------------
  107. bzr commit -m "migrated to trunk"
  108. bzr push --remember bzr+ssh://todd/mnt/repos/<project>/trunk
  109. ---------------------------------------
  110. Tell other developers that it's ready for testing.
  111.  
  112.  
  113. .Other developers test trunk migrations
  114.  
  115. ---------------------------------------
  116. cd /var/www/testing
  117. bzr checkout --lightweight bzr+ssh://todd/mnt/repos/<project>/trunk web
  118. ---------------------------------------
  119.  
  120. * (script: rsync files; generate settings.php; load db)
  121. * <test; report failure/success>
  122.  
  123. Migrate to XPT
  124. --------------
  125.  
  126. ---------------------------------------
  127. cd ~/websites/<project>
  128. bzr branch bzr+ssh://todd/mnt/repos/<project>/xpt
  129. bzr branch bzr+ssh://todd/mnt/repos/<project>/trunk
  130. cd xpt
  131. bzr merge ../trunk
  132. cd /var/www/xpt
  133. rm -rf web
  134. bzr checkout --lightweight ~/websites/<project>/xpt web
  135. ---------------------------------------
  136.  
  137. <test, test, test; announce to developers to test>
  138.  
  139. .If all is good, get ready to migrate to PRD:
  140.  
  141. ---------------------------------------
  142. bzr tag v2.0.0
  143. bzr push --remember bzr+ssh://todd/mnt/repos/<project>/xpt
  144. ---------------------------------------
  145.  
  146. Migrate to PRD
  147. --------------
  148.  
  149. ---------------------------------------
  150. cd ~/websites/<project>
  151. bzr checkout --lightweight bzr+ssh://todd/mnt/repos/<project>/xpt prd
  152. cd prd
  153. ---------------------------------------
  154.  
  155. .FTP to production site
  156.  
  157. e.g. ++lftp -u +produser@website.com+ ftp.website.com++
  158.  
  159. lftp> mirror -R -vv [<local dir> <remote dir>]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement