Support

Forums

Contact Me

Posts Tagged 'continuousbuild'

Status of the ContinuousBuild4Joomla framework

I put some effort the last few days in this new framework.

Done:

  • I did document some part of it at http://wiki.waltercedric.com/index.php?title=ContinuousBuildforJoomla
  • TeamCity is installed/configured/documented (windows only)
  • XAMPP is installed/configured/documented (windows only)
  • I also at the same time configured a Puppy Linux VMWare image that will permit to anybody to have a running environment in no time.
  • I am able to unpack all Joomla! versions that are committed in any repository (CVS, SVN, Clearcase)
  • They can be unpacked anywhere on file system (config in setEnv.xml), ideally they are unpacked in the root htdocs of XAMPP
  • Code is committed at Joomla forge in SVN http://joomlacode.org/gf/project/continbuild4j/

Issues

Selenium test suite do not accept a baseurl (or only a part of it) so I have a full path like /Joomla1.5.7/installation/index.php in a selenium test case instead of /installation/index.php in test case and baseurl= http://localhost/Joomla1.5.7)

Architecture

3rd Party

  • I use antelope for some advance ANT operations: substring, indexof, loop
  • I use selenium java server on port 4444 (default)

Cluster

All cluster operations are in cluster.xml these basic functions are

  • cluster.init
    • cluster.remove        remove all instances of Joomla! in checkout directory
    • joomla.unpack.all    unpack all Joomla! versions that are checked in another SVN root
    • joomla.install.all      run the same selenium test case joomla.install.html on all Joomla! instance
    • joomla.remove.all.installation   remove all Joomla! installation directories
    • joomla.check.all     check all Joomla! installations for correctness
  • cluster.start
  • cluster.remove
  • cluster.stop

Joomla!

All Joomla specific operations are in joomla.library.xml

  • Unpack a Joomla! version
  • Remove the installation directory form a version
  • Apply a selenium test suite install.joomla.html that can use the regular Joomla! installer
  • Is also able to do all of the above on all Joomla! versions found (regular expression) in checkout directory

Selenium

  • All selenium operations are in selenium.xml
  • All test suite and test cases are in /selenium/joomla/

PHPUnit

All PHPUnit operation are in phpunit.xml

Settings

Settings are in setEnv.xml, in future I will lazy load a file if it exist as environment variable

 

If you know ANT, the code is quite readable...

Future review of Joomla!® 1.5 Development Cookbook and Build and Manage Applications with Maven, Continuum, and Archiva

apache_maven

Packt publishing has offered me to make a review of two of their new books (Thanks to them). I should receive free samples for review beginning of next week. Since it is two of my favorite subjects (Maven and Joomla!® ), I think it may also interest you. A review will follow in some days.

ApacheMaven2EffectiveImplementation  

Build and Manage Applications with Maven, Continuum, and Archiva

  • Install Apache Maven and follow the sample application to build up your project as quickly as possible
  • Test your applications to ensure maximum stability using Maven's inbuilt tools
  • Use Maven's report and checking tools to ensure the health of your projects
  • Explore Apache Continuum which will help you to ensure the health of your source code
  • Improve your team builds with the powerful combination of Maven, Archiva and Continuum
  • Install and run the repository manager Apache Archiva
  •  

 

Joomla!1.5DevelopmentCookbook

Joomla!® 1.5 Development Cookbook 

  • Make your extensions extensible, add extensions points to allow third parties to customize your extension
  • Create international extensions by enabling multilingual capabilities
  • Build more than just HTML pages - create PDF documents, Atom Feeds, and more!
  • Improve the user experience by adding Ajax
  • Create Atom and RSS feeds to keep users up-to-date
  • Utilize the power of Subversion to maintain your source code
  • Execute database queries and handle returned data in order to access and modify your data
  • Dynamically extend your database tables using JParameter to make your extensions more flexible
  • Keep your gremlins at bay by handling errors the Joomla! way
  • Work with the file system, interrogate existing files and folders and store data in the file system
  • Take control of your workflows by using www.JoomlaCode.org to manage your Joomla! projects

Understand Agile Development Methods with the Agile Development Poster

Creating software with the agile development process delivers finished products quickly in fast changing and uncertain project environments. While agile development describes several iterative and incremental software development methods, they all involve continuous planning, continuous testing and continuous integration. (don’t under estimate effort to reach this prior to try to be agile)

All agile development methods focus on helping teams to collaborate and make decisions quickly and effectively. The most popular agile methodologies is now Scrum that is resumed in the poster below.AgilePoster.ai

Thanks to Agile software development, you will be able to accelerates the delivery of initial business value. Through continuous planning and feedback, agile development ensures that value continues to be maximized throughout the development process.

(Version One, 2009)

Continuous build for Joomla! part1/x

Automatic installation of Joomla! runtime environments

Main ideas

Build is scalable

Distributed build management optimize hardware resources utilization by parallelizing product builds within the build agents grid. With build chains support, it is even possible to break down a single build procedure into several parts to run them on different build agents — both in sequence and in parallel — using the same set of sources in all of them.

I want to be able to test my components against many versions of Joomla!

All versions of Joomla! are in subversion as zip files in an own SVN repository

For example:

  • ${JOOMLA15_VCS_ROOT}  is svn:\\localhost\joomla1.5\trunk
  • ${JOOMLA10_VCS_ROOT}  is svn:\\localhost\joomla1.0\trunk

These repository ${JOOMLAxx_VCS_ROOT} are connected to all build as supplementary VCS root in TeamCity and thus content get checked out as part of the build in the build temporary directory of one agent. ($AGENT_BUILD_DIR)

joomla1.5\trunk
                            Joomla_1.5.4-Stable-Full_Package.zip
                            Joomla_1.5.5-Stable-Full_Package.zip
                            Joomla_1.5.6-Stable-Full_Package.zip
                            Joomla_1.5.7-Stable-Full_Package.zip
                            Joomla_1.5.8-Stable-Full_Package.zip

So after the checkout, the file system will look like

($AGENT_BUILD_DIR)\                     

                                 Joomla_1.5.4-Stable-Full_Package.zip
                            Joomla_1.5.5-Stable-Full_Package.zip
                            Joomla_1.5.6-Stable-Full_Package.zip
                            Joomla_1.5.7-Stable-Full_Package.zip
                            Joomla_1.5.8-Stable-Full_Package.zip

If you don't want to provide support a a specific version of Joomla! just remove it from the trunk! or add new ones on purpose. That's easy.

Ant tasks/Maven MOJO

  • Are responsible for unpacking all these zip files to the build temporary agent directory. ($AGENT_BUILD_DIR).
  • Filenames are found with a configurable regular expression,
  • All settings will be committed in \joomla1.5\trunk\build.deploy.properties

Another ant script/task will for each zip,

  • Start a Selenium test cases that will create a virtual user that use the regular Joomla! installer and drive installation till the end.
  • All settings which have to be Joomla! and build independent will be randomly generated, preferably UUID for password and database name for example.
  • Login and Admin password may be the same (admin:admin) at the beginning but can also be generated and written to a file on disk in ($BUILD_DIR)/{joomlarootversion}/build.install.properties.
  • Directory installation ($BUILD_DIR)/{joomlarootversion}/installation will be renamed to ($BUILD_DIR)/{joomlarootversion}/installation.old or simply deleted
  • Selenium/PHP Unit test that are committed in \joomla1.5\trunk\Installation.Checks will perform basic checks (login, logout, navigate) to ensure that installation of Joomla! has been successful.
    If everything succeed, we will have a set of Joomla! versions ready for our components regression testing.

Remarks:

  • No build temporary directory. ($AGENT_BUILD_DIR) will be deleted by Ant or Maven but by the build server itself. This will let developer look at the issues on file system and in database.
  • New scripts may be developed to extract from the build server or Joomla! farm easily the non running Joomla! instance files + database) so developers can install the broken setup locally.

Automatic deployment of Joomla! components

Your component is typically shared and many developer committed regularly in a different VCS root... For SecurityImages 5.x.y, subversion root may be  svn:\\localhost\securityimages5\trunk

This VCS root is also attached to the build and get check out at build time by TeamCity.

Packaging

if a build.xml is present in {VCS_ROOT}\build.xml then it is executed prior to any further operations, purpose of build.xml is to produce a component binary distribution (zip or tar.gz) that can be then installed to ALL Joomla install in the agent root directory.

Deployment

if a deploy.xml is present in {VCS_ROOT}\deploy.xml then it is executed, purpose of deploy.xml is to deploy one or many component binary distribution (zip or tar.gz) to ALL Joomla install in the agent root directory.

Why one or many component?

I want to be able to track also component dependencies issues.

Lets say that SecurityImages does not play well with VirtueMart, I may want to test also that combination across Joomla! instances, that's why VirtueMart may have to be deployed with SecurityImages or not.

prerequisites:

  • Running SVN server, see HERE for installing it on windows
  • Installed JVM, latest JDK 1.6u10
  • Running TeamCity server
  • Running XAMPP with HTTP root directory at TeamCity agent root directory.
  • Apache ANT with additional library for more control (if, case, for loop)

This articles will be available in my WIKI soon http://wiki.waltercedric.com/index.php?title=ContinuousBuildforJoomla so any reader or developer can participate to the discussion, next step is to implement the above and that will e documented as well :-)

Running Selenium Grid and a set of Remote control as NT services

seleniumhq

Selenium has various projects that can be combined with each other to create a robust testing environment.

  • Selenium IDE: a Firefox add-on to record and playback tests in Firefox.
  • Selenium Remote Control: a client/server system to control web browsers locally or on other computers, using almost any programming language and testing framework.
  • Selenium Grid: transparently distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites. In-browser tests are inherently slow, but since commodity hardware is insanely cheap nowadays there is no excuse for not running all these tests in parallel on multiple machines and dramatically speeding up your feedback cycle. .
  • Selenium Core: JavaScript-based testing system.

Also there are Selenium projects specifically for Rails, Ruby & Eclipse!

Today I will show you how to make run some components of Selenium as Windows Services. I am using a Selenium HUB and 4 Selenium RC running all on the same server (while not recommended for performance reasons, it is the easiest setup)

In this small how to I provide you at the end of the article a ready to use Selenium Grid 0.7 zip file

Read more: Running Selenium Grid and a set of Remote control as NT services

Principles behind the Agile Manifesto

PrinciplesBehindTheAgileManifesto

We follow these principles:

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage.

Read more: Principles behind the Agile Manifesto

Tomcat 7 and Apache Maven

Here is 3 different way to control the lifetime a local Tomcat 7 container using Apache Maven. A typical scenario would be to start a servlet container prior to running integration tests (Selenium, SAHI or using any other framework you can think of )

With the following examples, you will be able to start an instance of Tomcat 7 running your web application in the pre-integration-test phase and stop the instance in the post-integration-test phase. You can also decide to use an embedded container like Jetty instead.

Read more: Tomcat 7 and Apache Maven

ContinuousBuild4Joomla project submitted to JoomlaCode.org

I will commit soon a first draft (alpha) of what is expected to bring continuous build to any Joomla! component (or event to Joomla! core itself ;-))

You are free to join the project, all documentation effort stay at the moment in my WIKI

 

Apache Maven copy local file to a remote server server using SSH

I will show you in an Apache Maven configuration file how to copy files to server each time the package phase is executed.

Solution with Ant SCP task

This snippet of code is a ready to use code that make use of Apache Ant task scp, Just put this snippet of code in your Maven module where the assembly is executed or anywhere else to push all tar.gz files to a server just run a maven mvn package, you can add as many ant task and push to many server the same file during the reactor build.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
    <id>server-copy</id>
    <goals>
        <goal>run</goal>
    </goals>
    <phase>package</phase>
    <configuration>
        <target>
            <echo message="Push to server/home/"/>
            <scp trust="yes"
                todir="user:password@server:/home/">
                <fileset dir="${basedir}/target">
                    <include name="**/*.tar.gz"/>
                </fileset>
            </scp>
        </target>
    </configuration>
</execution>
</executions>
<dependencies>
<dependency>
    <groupId>org.apache.ant</groupId>
    <artifactId>ant-jsch</artifactId>
    <version>1.8.2</version>
</dependency>
</dependencies>
</plugin>

Solution with maven-deploy-plugin

The maven-deploy-plugin allows you to configure the deploy phase to deploy to a server using scp. There is a page in the documentation that describes how it can be done.

Deploy maven artifact using Maven Wagon SCP

Another alternative would be to use Maven Wagon SCP like described in this post for example

Tux Droid Plugin for Jet Brains TeamCity 4.0

tux-droid-linux-companionTux Droid is a Linux wireless Tux mascot (210mm x 180mm x 140mm - with lowered wings) with a programmable interface, allowing it to announce events by its gestures and by ALSA driven sound. The events are detected by specific gadgets, which are handled by the Tux Gadget Manager. The Tux Droid supports Linux kernel 2.4 or later and needs a 800 MHz CPU and 128 MB RAM. It communicates by infrared to the USB port (1.1 or 2.0) and for media detection it needs an internet connection. The mascot is driven by Atmel AVR RISC microcontrollers. From http://en.wikipedia.org/wiki/Tux_Droid

TeamCity is a Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper.

 

 

 

 

Read more: Tux Droid Plugin for Jet Brains TeamCity 4.0

Donations

Thank You for supporting my work