Creating an Drupal App Server

2 minutters læsning

I have just figured out, how I can create my own app server. If you want to follow in my steps, I have created an install profile, you could utilize (and maybe give some feedback to). The install profile for the Drupal App Server is available at github. As a working title I have called the install profile Open Apps.

Create the App

First, you should create an app. You can find directions for building the app here. Put the appname.info and appname.module file into your appname-folder with the files stated in the mentioned howto about Drupal Apps. Package the folder using your zip program and name it appname-7.x-X.Z.zip. There is probably smarter ways to do it - and if, please let me know in the comments.

Create the App Server

Use the installation profile, I have created. Fire up your command line (you should have git, drush and drush make installed):

<span style="display: none; "> </span>$ git clone git://github.com/lsolesen/apps-deploy.git
<span style="display: none; "> </span>$ cd apps-deploy
$ drush make openapps.make ~/localhost/openapps

Make sure that all the correct permissions is set for the files directory and the settings.php file. Create a database for your openapps. Then open your webbrowser and point it to your Open Apps installation. You should see a normal Drupal installation with the Open Apps installation profile. Go through all the settings, and you should be ready to create your own apps.

First, go to admin/structure and edit the taxonomies. A vocabulary with Server Type has already been setup. Add a term, e.g. Production.

Second, create your App release with your manifest. You can see an example here. Make sure that the App you created is downloadable from somewhere. Right now, I have just uploaded it via FTP to a public location. However, I would prefer to make it available on a featureserver (and I am still playing around with the installation profile to have it install e.g. fserver also).

Third, now the server should work. The url for the server’s JSON feed is at app/query/SERVERTYPE. If you choose Production it will be on app/query/Production. This url i used for your Drupal site which have installed the apps module.

Using the server

You should tell apps about your apps server. You can do that by creating and enabling a module, that exposes the url to apps. The module to enable the apps server should look like this. It seems that you have to fiddle with the permissions on the sites folder to get apps to work correctly.

Caveats

Both appserver and apps is fairly early in development, so there are still some bugs. It seems that the required modules are not enabled automatically yet, and stuff is not automatically uninstalled when unenabling the apps. Also, I am not sure how different dependencies in different apps will be handles (e.g. some using views-3.x-dev and other using views-3.0-rc3). But you should start playing around with it now.

Please let me know if things could have been smarter, but please keep away from comments about Drupal Apps being poison for the Drupal Community. IMHO Apps will improve the usability of Drupal. Hopefully most developers and companys will keep their apps free.

Kommentarer

Erik SUmmerfield

Would you be interested in writing up a README.txt for the appserver and contributing with a patch? Maybe just pull out the parts about how to set up the taxonomy and an app in the server and then how to access it from the apps module? http://drupal.org/node/1355132 This is a good overview of how to set the two up for use. Also there is a group start at #drupal-apps to talk about and help out with apps.

Brian Wood

Are you actively using this combination of fserver and appserver? I too am interested in using fserver to host the tar.gz or zip files that are served by appserver. It works, but it’s cumbersome to add a new app or a new release. Creating some relationships between the fserver and app release entities would help. Let me know if you want to discuss this more. If you happen to be going to DrupalCon Denver, I’ll be there. Thanks for your write up!

New URL for Phase2 Page

The OpenPublic/Phase2 page on how to build apps is now at http://products.phase2technology.com/display/commondocumentation/How+to+Build+an+App

Skriv en kommentar

Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret *

Indlæser...