Changes between Version 5 and Version 6 of CodeManagementReleaseProcess
- Timestamp:
- 11/25/11 18:35:10 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodeManagementReleaseProcess
v5 v6 21 21 1. You may occasionally want to update the TEST and DEV site's databases and files to match the live server by using the DevelopmentServer#live2dev script. 22 22 23 ---- update to HERE ---24 25 26 23 == Software & Getting Started == 27 24 You obviously must have Git installed on your machine to work on this project. The basic Git command line software available for most platforms in from http://git-scm.com/ - however, some very nice applications are also available that integrate into your operating system's graphical interface. Recommended '''FREE''' Git applications with a nice GUI are: … … 45 42 This process gets you from a basic checkout of the code, through committing and testing, to a proper release on the LIVE server. By now you should have a copy of the code checked out as per the section above. 46 43 47 The process is as follows :44 The process is as follows, and assumes you're in the root of your working directory: 48 45 49 46 … … 51 48 You MUST start by getting all the changes in the the origin GitHub repository... 52 49 * If you've not already cloned the branch you want to work with, follow the instructions above in 'Getting Started' 53 * If you have, you'll need to pull the latest changes: 50 * If you have and haven't made many changes, you'll need to pull the latest changes with a {{{git pull}}} 51 52 53 === 1. Creating/Working with your own branches === 54 If you're working on something and need to keep these changes from the rest of the development, always make your own branch on your local machine. Read the Git documentation for this, but the process is roughly as follows: 54 55 {{{ 56 git branch [newbranch] <--- creates a new branch called [newbranch] 57 git checkout [newbranch] <--- switches your working directory to it 58 }}} 59 You can then switch branches with no loss of work or confusion by using {{{git checkout [branch]}}}, where [branch] is the branch you want. You can see the branches available and active by using {{{git branch}}}. Use as many branches as you need to work locally, but please only send changes to GitHub when a) they're on live and development branches, or b) they're part of some new project or collaborative effort. 55 60 61 62 === 2. Edit you code, test locally === 63 As you modify the source code and theme files on working branch, the differences between your copy and the original branch (live or development) will grow. Clearly, if several developers are working on the same areas at once, you will have merge your changes carefully. 64 65 To add and commit your code and merge 66 {{{ 67 git add -A 68 git status <--- will show you what's changed, tidy up if needs be! 69 git commit -m "a nice description of the commit" 70 }}} 71 The above makes sure your working directory code changes are copied to the staging area and ready to be merged. Make sure you add a good description in case someone needs to roll back a commit to fix an issue. Then, repeat this step until you're ready to... 72 73 74 === 3. Merge your code and push back to Github === 75 When you're happy your work is tested and complete, you'll want to merge it back into a the 'development' branch for testing on the DEV server: 76 {{{ 77 git status <--- will show you what's changed -- double check! 78 git checkout [target branch] <--- should be 'development', but could be 'megaproject5' or even 'live' if you like killing kittens 79 git merge [working branch] <--- wherever you've been working and committing 56 80 }}} 57 81 58 === Creating/Working with your own branches === 59 If you're working on something and need to keep these changes from the rest of the development, always make your own branch on your local machine. Read the Git documentation for this, but the process is roughly as follows: 82 If the above goes well, your changes will automatically be merged in. If not, it's time to read up on how to manually [http://gitref.org/branching/#merge|merge changes]. Once the merge process is complete, you'll want to push your changes to the 'development' branch back to Github: 60 83 {{{ 61 git branch [newbranch] 62 git checkout [newbranch] 63 ... do your stuff ... 84 git push -u origin [target branch] <--- pushes all updates back to [target branch] (probably 'development') 85 }}} 64 86 65 === 1. Edit you code, test locally ===66 As you modify the source code and theme files on your checked out working copy, the differences between your copy and the Trunk will grow. It's wise therefore to do smaller chunks of work and commit once these specific bits are completed. Clearly, if several developers are working on the same areas at once, you will have to coordinate your work and be more careful.67 87 68 To update the Trunk (DEV) with the tested changes you've done so far [with information in square brackets]: 69 {{{ 70 cd /the/directory/you're/working/in 71 git add -A [this adds any files not already in the repo]] 72 git commit -m "A sensible description of what you've done" [applies your changes locally] 73 git push -u origin [pushes all updates back to repo, will need password] 74 }}} 75 Make sure you add a good description in case someone needs to roll back a commit to fix an issue. Then, repeat this step until you're ready to... 76 77 === 2. Test on the DEV server === 88 === 4. Test on the DEV server === 78 89 This step is critical because the DEV server mirrors the setup on LIVE. Hence any issues or differences you didn't spot whilst working on your local machine can be ironed out here. It also allows you to get feedback on your work so far as required. 79 90 … … 82 93 ssh dev.transitionnetwork.org.webarch.net 83 94 cd /web/dev.transitionnetwork.org.webarch.net/www 84 sudo svn up 95 git fetch origin <--- 'origin' is github in this case 85 96 }}} 86 The last command bringsthe DEV site up to the latest Trunk version. Go to http://dev.transitionnetwork.org.webarch.net/ and enjoy the fruits of your labour.97 The last command gets all the updates to all branches the DEV site up to the latest Trunk version. Go to http://dev.transitionnetwork.org.webarch.net/ and enjoy the fruits of your labour. 87 98 88 99 Depending on the changes, you should test properly and then solicit feedback and testing from managers/stakeholders. This is probably on DEV, but could be on TEST if needed. 89 100 90 === 3. 'Tag' (copy) the release ===91 Once everyone is happy with the DEV site updates, you will nee/root/.my.cnfd to 'tags' (svn copy) the release so it's ready to be moved onto the LIVE server - or the TEST site if needed (more on that in a moment).92 101 93 You need to SSH into the DEV server and go to the website root folder (as above). Then run these commands to tag the release: 94 {{{ 95 sudo svn cp https://tech.transitionnetwork.org/svn/www/trunk https://tech.transitionnetwork.org/svn/www/release/2010-11-23 -m "Release version 2010-11-23" 96 }}} 97 All releases go in the browse:www/release folder on in the SVN repository with the date as the sub folder name. The above commands will make a copy of Trunk as it stands and then move it to a new folder ready for release to TEST or LIVE. 98 99 === 4. Release to LIVE (or TEST) === 102 === 5. Release to LIVE (or TEST) === 100 103 Please note the documentation for the LIVE server is here: wiki:NewLiveServer - and you should have decided whether or not it's necessary to do a run of testing on the TEST site before moving to LIVE... The process for both is the same, just on different machines. 101 104