(What is a feature server and how can it help you? Read a great introduction and watch a great insight.)
Being not as well-documented as many would like, setting up a feature server to provide your sites with up-to-date features which you have created can be a hassle.
In this post, I’m trying to summarize the process of setting it up and getting it to work. I will not provide any information on how to use advanced features like providing updates via git, as I haven’t figured out how to do so myself. When that time comes, I will link any relevant information here.
Important: As of today, a feature server can not be set up on a D7 install, which however is not a problem to most of us as it is still capable of serving D7 features.
Install Drupal and dependencies
Grab the latest version of Drupal 6 (see note above), unzip and install it.
Apart from the listed dependencies of the fserver module, you need to install CCK! As a D7 user from the start, I needed a while to figure out that dependencies I couldn’t find, like “content”, were all included in CCK.
Set up the feature server
The server is basically set up. Watch this screencast to see how to use the server to provide features, and continue reading.
Make it work (drupal update & drush make)
This part is based on my own “research”, or rather trial-and-error late hours trying to get it to work. Right upfront, I want to tell you, that I have no clue WHY the following solution works, but it simply does. Any comments are appreciated.
When viewing a project, fserver shows you a url to include in your drush make scripts or .info files. This one, as often as I tried it, does not work.
Let me explain. To get the XML feed with the release history of a module, let’s say it’s called our_module, one has to navigate to http://yourfserver.com/fserver/our_module/7.x and you get all available D7-compatible versions (try it).
But you don’t need to give Drupal or Drush the full URL. It appends the name of the module and it’s own Drupal core version itself, it only needs http://yourfserver.com/fserver to go and look for it. This also is the URL that you are given with your project. Which doesn’t work.
This simple solution fixes it: Append a / to it. The working URL is: http://yourfserver.com/fserver/ and that’s it.
This is “fine” when you’re alone, working on some projects. But your staff or the next maintainer will run into the very same problems, copying the wrong URL. To fix this, you have to edit the fserver.module : In the fserver_nodeapi function, append the / to the “fserver”-parameter given to the url-function. It'll display the correct URL on your projects' sites from now on.
Add your fserver url to your features
That’s it, you can now use your fserver with your features. When generating a feature, do not forget to paste the URL we fixed above into the fserver-field under the advanced tab. This ensures drupal can look for updates.
Use your fserver to download modules with drush and drush make
Using the source-option, you can download your hosted module with drush:
drush dl --source=http://yourfserver.com/fserver/ our_module
Using the following lines, you can include your hosted module in a drush make file:
projects[our_module][type] = module
projects[our_module[location] = http://ourfserver.com/fserver/
Don’t forget the trailing slash!
Secure your fserver
As an update, I recently wrote a blog post about securing your fserver with a password. Go check it out if you're interested.
If you have any suggestions or a better approach, please comment.