Build and Run JEE Applications in the Cloud

CloudBees offers a service to build and run JEE applications. After registering you get an ready to use Jenkins build system and an application server instance to run your application. Both is free with some limitations. The best thing is: You can combine both services. After building your application Jenkins is deploying it automatically to it’s CloudBees fellow and the build result is online and ready for use immediately afterwards.

I choosed an easy to install web application to test the service: Pebble, a lightweight, open source, Java EE blogging tool, build my maven. The goal was to build and run Pebble by CloudBees.

Since I had to change to maven configuration of the Pebble project a little I imported the SVN repository to my own at github. After that I could change and commit the pom.xml to run Maven goals of CloudBees. In the pluginRepositories of the pom.xml section I added:

 <pluginRepositories>
   <pluginRepository>
     <id>bees-plugins-snapshots</id>
     <url>http://repository-cloudbees.forge.cloudbees.com/public-snapshot/  </url>
     <releases>
       <enabled>true</enabled>
     </releases>
     <snapshots>
       <enabled>true</enabled>
     </snapshots>
    </pluginRepository>
 </pluginRepositories>

and the following to section build:

<build>
   <plugins>
     <plugin>
       <groupId>com.cloudbees</groupId>
       <artifactId>bees-maven-plugin</artifactId>
     </plugin>
   </plugins>
 </build>

After that I switched over to CloudBess and added the Applications service to my account which is also called RUN@cloud. In the service configuration I added a new application called pebble. No more configuration is needed here since Pebble needs no external database to run.

Next think was to add the Jenkins service to my account, called DEV@cloud. Jenkins is configured by the standard web interface:

I created a new job and choosed Build a maven2/3 project. In section Source Code Management of the job I selected Git an entered the Url of the repo: git://github.com/murygin/pebble.git.

More complicated is section Build. Here you have add the maven goal of CloudBees to deploy the application the application server:
bees:deploy -Dbees.appid=[ACCOUNT]/[APPLICATION± -Dbees.apikey=[API-KEY] -Dbees.secret=[SECRET-KEY]

API key and secret key you find in your CloudBees account settings.
Remember: This maven goal only works if you added the CloudBees plugin to your pom.xml as described above.

After running the job the project was build and deployed to the CloudBees application server. See my running example at: http://pebble.murygin.cloudbees.net/

    • Cyrus.31
    • 31. Oktober 2011

    don’t forget to change your defaults usernames/passwords.

    • I changed the default password of the pebble installation. Thanks for the reminder.

  1. No trackbacks yet.

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

%d Bloggern gefällt das: