Using svndev
Contents
Intended Audience
This document is for Shelly, Rick and other designated SCCC web editors. Anyone else can read it, but I have no idea why they would want to.
Changes
I've renamed the 'trunk' branch 'dev'. This changes nothing except you now have to specify 'dev' where you would have specified 'trunk' before. I've changed all references in this doc to reflect this. In other words, if you haven't read this doc before, you can ignore this paragraph.
Overview
I've finished a simplified workflow automation that makes using SVN when editing files on dev much more usable. Rather than send a zillion emails back and forth, I'm starting this document as a central place for our wisdom.
Basically, dev has a virtual host called svndev. For all intents and purposes, another web server. Point your web browser at http://svndev.seattlecentral.edu, and you'll see a clone of tintin.
The cool part is, when you make changes to the correct SVN repository and branch, those changes will automatically appear on svndev, so there's no more extra steps. My next feature will be a system that allows you to choose which branch/version/tag you want to display on svndev.
There is no versioning of MySQL content at this time. I'll have to think about how to implement that.
HOWTO
The following are the steps you need to follow in order to make changes on svndev.
Mini Glossary
- working copy or WC
- The copy of the files you have on your computer, in your office, on your desk. Not the copy on the SVN server or the web server.
- repository or repo
- Where SVN stores it's data. This is not the files on your computer or the web server
- check out or co
- Make a working copy of the data in the repository on your local machine
- check in or co
- Upload any changes from your working copy to the repository
- update or up
- download anyone else's changes from the repository
Initial Checkout
You do this only once when you get started working on svndev. You would need to do it again if you delete your local working copy, or if you started working on a different computer.
- open windows explorer and go to directory where you like to keep files you work on ( e.g. My Documents ).
use Tortoise SVN to check out the repository at https://www.seattlecentral.edu/svn/web/dev
you will be required to log into the SVN server. You shold already know your password and username. Dylan can fix that for you if you like, or you can do it yourself. To do it yourself, use htpasswd to add your credentials to /usr/local/svn/.htpasswd on arthur.
- You should get a shiny new directory called 'dev'.
The SVN repo lives on Arthur. The web pages live on Svndev. Your working copy lives on your computer.
Update your Working Copy
Before you make any changes, you need to make sure your working copy has any changes made by anyone else.
You should do this a lot. If you're pedantic, you do it before you make any changes to your working copy. If you're less pedantic, you do it every now and again as you work, between major changes, but not between each little change. If you're lazy, you only do it once a day, which I don't recommend.
- using Tortoise SVN, do 'up' or 'update'. I think it's best to do this by right-clicking on the 'dev' folder, but I could be wrong.
Making Changes
You save your changes into your working copy first, then use SVN's check in command to upload the changes to the SVN repository and the web server.
- Using your editor of choice (Dreamweaver?) open the appropriate files in your working directory, edit them and save them. The copies in your working copy are now changed.
- Using Tortoise SVN do a "check in". Again, I think it's best to do this by right clicking the 'dev' folder and selecting 'check in'.
See your Changes
This is the cool part. Normally with SVN or another VCS, you would have to log onto dev with putty and do some SVN commands and run some build scripts. This is done automatically for you.
go to http://svnweb.seattlecentral.edu and you will see your changes.
A More Concrete Example
Just to be totally complete, here's a made up example. I don't have windows or Tourtoise SVN in front of me, so I'm making this all up. Any corrections would be awesome.
Go to My Documents with the windows explorer.
Right click on My Documents, find the Tortoise SVN 'check out' command.
It will ask you for a URL, type https://www.seattlecentral.edu/svn/web/dev
- It will ask you for a username and password. These are SVN specific.
It will spend some time copying files to your My Documents\dev directory.
You will find a dev directory inside My Documents.
Go into that dev directory.
Go to webroot.
Open index.php with Dreamweaver.
- Find the bit that looks like
<!--- Announcements --> <?php echo $news->Announcement(1) ?> <!-- SNOW CLOSURE MESSAGE
Write something silly, preferably in <h1> or <h2> tags. For example,
<!--- Announcements --> <h1>All classes involving pudding are suspended until further notice!</h1> <?php echo $news->Announcement(1) ?> <!-- SNOW CLOSURE MESSAGE
- Save your changes
Using the windows explorer, right click on the dev directory
- Find and run the 'check in' Tortoise SVN command.
Go to http://svndev.seattlecentral.edu and see your change
Right click on dev again
- Find and run the 'update' command
Open webroot\index.php with Dreamweaver again.
- Make another change
<!--- Announcements --> <h1>All classes involving ice cream are suspended until further notice!</h1> <?php echo $news->Announcement(1) ?> <!-- SNOW CLOSURE MESSAGE
Right click on dev again
- Find and run the 'check in' command
Go to http://svndev.seattlecentral.edu and see your new change
