Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

IDE setup/Development workflow best practices


Go to End
Reply


10 Posts   3210 Views

Avatar
vwd

Community Member, 160 Posts

18 March 2011 at 9:19am

Hi,

I'd just like to find out what setup people are using for SilverStripe site, theme, template, extension development please?

The way I have things setup at the moment doesn't seem to be optimal or clean, so I was looking for suggestions to improve. (My IDE of choice is Netbeans. I'm running MAMP.)

My current initial setup procedure is:

  • I copy SilverStripe install files into my local web-server public_html folder
  • Start up and configure SilverStripe and the MySQL DB (through phyMyAdmin)
  • Once configured, I copy all files from the newly configured SilverStripe install from my web-server to my...
  • working source controlled development folder
  • I create a new Netbeans project (with existing sources in this development folder)

My development workflow is:

  • Edit code, modify, save, Run/Debug
  • The Netbeans project is configured to copy all files across to the web-server on each run/debug (I'm nervous about this because any changes to files (eg. _config.php) made by SilverStripe in the live install will be overwritten)
  • Once content has been entered, I save a MySQL dump back into my development folder to be source controlled.

Some of the issues I'm a little uncomfortable with are:

  • After SilverStripe is configured initially and I copy configured files across to the development directory, there is a possibility of missing some files like I did (some hidden files - .htaccess - didn't make the journey... as I found out the hard way initially)
  • Potential for changed files in live SilverStripe install (web-server) to get overwritten when the IDE copies files from development folder across on a Run/Debug

So - any suggestions to improve my setup please? How do you work? What's your setup?

Thanks very much.
VWD

Avatar
Willr

Forum Moderator, 5513 Posts

19 March 2011 at 6:31pm

Potential for changed files in live SilverStripe install (web-server) to get overwritten when the IDE copies files from development folder across on a Run/Debug

You should only have project information in your _config.php and store your server details (passwords etc) in an _ss_environment.php file (http://doc.silverstripe.org/sapphire/en/topics/environment-management) this will allow you to update _config without worrying about updating it on the live site.

Potential for changed files in live SilverStripe install (web-server) to get overwritten when the IDE copies files from development folder across on a Run/Debug

Really you shouldn't be altering files on the live server (other than the _ss_environment). You're asking for trouble with syncing live / dev!

Avatar
vwd

Community Member, 160 Posts

21 March 2011 at 3:12pm

Thanks for that info Willr. I did feel a little uncomfortable too... (I've used this workflow developing WP themes)

So what would you recommend to be a typical, safe, theme development workflow?

If possible, I would like to have my project development folders source controlled and separate from the dev. web-server also. So I can't run SilverStripe in my project dev source folders as there isn't a web-server serving from those folders...

Avatar
Willr

Forum Moderator, 5513 Posts

21 March 2011 at 8:50pm

Edited: 21/03/2011 8:50pm

If possible, I would like to have my project development folders source controlled and separate from the dev. web-server also. So I can't run SilverStripe in my project dev source folders as there isn't a web-server serving from those folders...

The SilverStripe source does need to be in the folder serving your webpage (unless you symlink things in). The typical workflow (for nearly all the environments I've seen) is to keep the entire project folder source controlled in 1 repo and pull in the modules + sapphire/cms via tools like piston (http://piston.rubyforge.org/) or svn:externals. Much easier with svn to handle this but with core moving to github piston is becoming the recommended way.

If you are working on multiple themes at once then you could setup SS outside of version control and simply have checkouts (or clone's in git) for each theme nested inside the themes directory.

Avatar
vwd

Community Member, 160 Posts

21 March 2011 at 11:02pm

Fair enough Willr. I'll have a think about how I can adapt my workflow. I'll have a look at Piston also - looks interesting.

Thanks very much for your help.

VWD.

Avatar
Mo

Community Member, 510 Posts

22 March 2011 at 1:02am

If it helps, my current workflow is like this:

Step 1:
Project checked out from SVN on my local machine. All third party modules and core code (sapphire and cms) are pulled in using svn:externals.
I develop code using netbeans.

Step 2 (optional):
If possible I have a development server, separate from the live server to test on. I check code into subversion which is hosted by beanstalk (http://beanstalkapp.com/). Beanstalk allows me to setup "deployment", so that all my code is automatically deployed to the dev server from svn trunkon commit.

Step 3:
I tag final releases of my code to go live in SVN, then deploy that tag from beanstalk to the live server.

Beanstalk isn't the only service that offers deployment like this, I know Assembla (http://www.assembla.com) does as well, probably a lot of others.

I haven't looked into using Piston yet, I have been trying to work out if it is similar to Fabric. Are there any plans for adding documentation on its use to doc.silverstripe.org?

Hope that helps.

Mo

Avatar
Mo

Community Member, 510 Posts

22 March 2011 at 1:03am

Oh, and I also use separate environment files across all servers, as Willr recommended.

Mo

Avatar
vwd

Community Member, 160 Posts

28 March 2011 at 4:56pm

Hi Mo,

Thanks again for your input.

So I assume by 'project files' you mean everything under mysite/ & themes/ ?

Thanks Mo.
VWD.

Go to Top