First steps
A basic workflow for creating a site product using Buildout and Subversion.
How quickly can I build a web site?
Using best practices, of course.
Build a site product
I'm putting theme and configuration into a site product and keeping it under version control.
Just install DIYPloneStyle (anywhere, really, but I put it in /webapps).
cd DIYPloneStyle
./bin/generator.py -p mySite
Then put it under version control in the products directory.
cd ..
svn import mySite http://svn.combsnet.com/mySite/trunk \
-m "initial DIY template"
svn mkdir http://svn.combsnet.com/mySite/tags
-m "Code releases"
svn copy http://svn.combsnet.com/mySite/trunk \
http://svn.combsnet.com/mySite/tags/release-1.0 \
-m "Release 1.0 is the default template"
cd zopeb/products
svn co http://svn.combsnet.com/mySite/trunk mySite
rm -rf ../../mySite
Customize the theme
Here's the basic overview:
Version 1.1 -- I add, configure and extend base_properties, make color and font changes to the CSS to use the base_properties, and add images (at least the logo). I may format the global tabs, page width, and background.
Version 1.2 -- Add and modify main_template, footer_template.
Version 1.3 -- Support portlets and Rich content types.
Version 1.4 -- Support editing controls.
I have some basic images I start with, though of course I customize them: mySite-logo.jpg, outside-bg-blue.png, tabSprite-blue.png, featureBox-blue.png (don't forget the .metadata files so they will cache).
Warning: The mySite-logo.jpg.metadata file prevents the public.css file from generating. For now, name it mysite-logo.jpg.NOmetadata.
The .metadata files simply contain:
[default]
title=
content_type=image/png
cache=HTTPCache
Don't forget to add them to version control:
svn add mySite/skins/mySite_images/*
The next step is modifying the base_properties.props and jamiesite.css.dtml files. You might also want to remove the unused files.
svn rm base generated.css.dtml portlets.css.dtml public.css.dtml
Change the version.txt to 1.1a1, test, change to 1.1a2, test... until you're satisfied. Commit if you need to. Check your results with http://localhost:3036/Plone. The port number is set for use at Webfaction.
svn commit \
-m "Basic theme: logo, colors, tabs"
Once I get the logo, basic colors and tabs in, that's version 1.1. Don't forget version.txt; change the version. Create a tag to show you've reached 1.1:
svn copy http://svn.combsnet.com/mySite/trunk \
http://svn.combsnet.com/mySite/tags/release-1.1 \
-m "Release 1.1 has the logo, basic colors, and tabs"
When you're ready, change your buildout.cfg to install the site product. You should rebuild and test locally, running in debug mode, just to make sure you didn't introduce a typo into your buildout.cfg.
./bin/instance stop
./bin/buildout
./bin/instance fg
If it works, check it into subversion.
cd ~/webapps/zopeb
svn commit buildout.cfg -m "added a mySite v1.1"
svn copy http://svn.combsnet.com/plone25buildout/trunk \
http://svn.combsnet.com/plone25buildout/tags/release-1.6 \
-m "release 1.6 added the mySite v1.1 product"
Deploy
Once the site is stable in the staging environment, you can deploy it live.
Note... this isn't quite right. I have to delete the products in ~/webapps/zopeb/products before buildout works.
ssh -l myUID myUID.webfactional.com
cd ~/webapps/zopeb
svn co http://svn.combsnet.com/plone25buildout/trunk .
./bin/instance stop
./bin/buildout
./bin/instance start
And there you have it.
The next version
If you continue to develop your product now, when you check it in, it will go into the last /tags/release-1.1 repository. You want to new work to go back into trunk, so you should delete the released version and checkout a new copy from the trunk.
cd ~/webapps/zopeb/products
rm -rf mySite
svn co http://svn.combsnet.com/mySite/trunk mySite
Undo
Sometimes, your improvement isn't, and you need to go back to a prior version. Those instructions are coming up.
Merge a branch back into trunk
cd ~/webapps/zopeb/products
mv mySite mySiteBranch
svn log --stop-on-copy
make a note of the revision number A
cd ..
svn co http://svn.combsnet.com/mySite/trunk mySite
make a note of the revision number Z
cd mySite
svn merge -r A:Z http://svn.combsnet.com/mySite/branches/mySiteBranch
svn commit
Use svn info to make sure you're working on trunk, and not a tagged release.
x