Support

Forums

Contact Me

Posts Tagged 'teamcity'

TeamCity

TeamCity is a Java-based build management and continuous integration server from JetBrains. [http://en.wikipedia.org/wiki/TeamCity]

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...

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 :-)

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

 

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

TeamCity 5.0 now available

Amazon EC2 and Virtual Agents

Take avdantage of cloud computing with TeamCity by putting Build Agents on Amazon EC2. After your Build Agents' AMIs (Amazon Machine Images) are registered, the TeamCity server will account for those virtual machines in its build scheduling and will automatically do a suspend/resume job on them, based on the load and build queue status.

Better Support for Maven

Version 5.0 has many Maven support improvements under the hood. These include the creation of Maven-based build configurations (only the URL to the POM file is needed), the visualization of various project data gathered from POM, and a new type of dependency trigger - Maven artifact trigger. This type of trigger starts a build each time the specified Maven artifact changes.

Build Configuration Templates

Templates can save a lot of manual work when you need to define a number of duplicate or very similar build configurations. Now you can create a template with the common (shared) settings, and then inherit any number of build configs from this template. You can also extract a template from any of your existing build configurations.

Issue Tracker Integration

How often do you see comments like this: "TW-3431 fixed"? How about a little more detail on the issue at hand? The issue tracker integration provides an in-place bug title, direct navigation to the issue, and other productivity goodies. It is currently available for Jira, Bugzilla and JetBrains YouTrack out of the box, but can easily be extended to other systems via plugins

Command Line Tool for Personal Builds

Previously, if you weren't using Eclipse, IntelliJ IDEA or Visual Studio, you were out of luck for missing one of the most important TeamCity features - Remote Run and Pre-Tested Commits. But things have changed. As the name suggests, now you can initiate the building of your local changes remotely on the server - from the local command line. No IDEs required.

Many Other Improvements

Including:

  • Per-test responsibilities
  • Build artifacts promotion
  • Dedicated change details/status page
  • Incremental update of the build log
  • Project archiving
  • Backup & Restore for easier TeamCity maintenance. Backup can be started from the UI or from the command line; Restore and Migration can be started from the command line only. Command line backup does not require stopping TeamCity if an external database is used.
  • Audit of user actions
  • Coverage support for .NET & Java. Based on IntelliJ IDEA coverage engine for Java and on NCover
    (ver 1, ver 3) or PartCover for .NET.
  • Git & Mercurial support now bundled with TeamCity
  • Remote Run for Git from IntelliJ IDEA & Eclipse
  • Support for Cucumber, Shoulda, Test-Spec in Rake runner
  • TeamCity IntelliJ IDEA plugin now works with IntelliJ IDEA Community Edition and RubyMine.

    Download TeamCity 5.0 (free 60-day trial). See also complete release notes

My 2 first Joomla! component in continuous build

teamcity.joomla

Status/Done

Read more: My 2 first Joomla! component in continuous build

Update JetBrains TeamCity in one click

penguin  A small script developed to upgrade TeamCity with no or less effort! a very simple script, easily extensible.

TeamCity is a continuous integration and build management system. With TeamCity, you can set up a build server within minutes and enjoy out of the box continuous unit testing, code quality analysis, and early reporting on build problems — even without leaving your favorite IDE. TeamCity offers a gentle learning curve, so you can quickly improve your release management practices by gradually adopting its advanced features and capabilities.”

 

 

Limitations

This script only work if

  • You run TeamCity using the standalone package provided at http://www.jetbrains.com/teamcity/download/index.html#linux under Linux
  • You use MYSQL as an external DB
  • You must run it as root (because getting the latest software with wget may not otherwise be possible)
  • This script is not endorsed by JetBrains nor official.
  • GNU/GPL version 3, use at your own risk, provided as IS

It must be safe to use, as

  • It backup first your database
  • it archive your existing TeamCity installation with a timestamp
  • it also copy any customizations (server.xml, agent build.properties) you have made to the new installation
  • It download automatically and extract teamcity

Usage

# ./updateTeamCity.sh newVersionNumber installPathHome

example:

/home/teamcity > ./updateTeamCity.sh 4.5.4 /home/teamcity

Output of the script

stopping current TeamCity at /home/teamcity/TeamCity
done!
Read database settings from database.properties
Moving current TeamCity /home/teamcity/TeamCity to /home/teamcity/TeamCity.20093830
done!
Saving database to file system at
/home/teamcity/TeamCity.20093830/teamcity.sql
done!
getting the latest version at http://download.jetbrains.com/teamcity/TeamCity-4.5.4.tar.gz
done!
Unpacking new version
done! 
Copying previous customizations
done!
Copying required 3rd party librairies
done!
Copying local agent build.properties to new TeamCity
done!
Starting new TeamCity
done!

Don’t expect more at the moment, it has been created to make the update of TeamCity faster for ME now. Feedback is appreciated, and improvement/ideas are always welcomed.

GET THE SCRIPT updateTeamCity HERE

Continuous Build for Joomla

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. This article is a quick overview of Continuous Integration summarizing the technique and its current usage. Martin Fowler about continuous integration

Things get clearer in my mind...I will use a set of Open Sources software to reach this ambitious goal.

Brainstorming

Maintain a Single Source Repository.

Either Subversion running locally on windows/Linux, but I will stay with www.joomlaCode.org at the beginning

Automate the Build

  • I am currently evaluation Maven for PHP but already have ANT script to build components and plugin for Joomla 1.5 (they are not generic enough at the moment)

Make Your Build Self-Testing

  • PHP UNIT tests if available with be run at this stage using PHP command line.
  • Selenium to automate components testing across many platforms, as it runs in many browsers and operating systems, and can be controlled by many programming languages and testing frameworks.
  • Some standard utilities to perform standard Joomla! processes: login, logout for Apache ANT or Selenium
  • I will develop either a ANT plugin or a set of Selenium test cases for deploying and removing
    • component: install, publish, remove
    • plugin: install, publish, remove
  • All these utilities will be available under GPL v3 and as such free to reuse, and improve.

Everyone Commits Every Day

  • This is reserved to developer having a www.joomlaCode.org account and part of the development team.

Every Commit Should Build the Mainline on an Integration Machine

I will use TeamCity continuous build server as it is free for personal use (limited to 20 concurrent build), run on Windows and Linux but require a java VM to run (may not be wanted in a PHP environment). Anyway with ANT, it will be possible to use another build server like Cruise Control or PHP Under Control.

Keep the Build Fast

That is an objective :-)

Test in a Clone of the Production Environment

Joomla! Build farm

  • I can imagine a set of Joomla instances, ideally 5 of each version, aka Joomla! 1.5.3 to Joomla! 1.5.8 and Joomla! 1.0.10 to 1.0.15
  • Joomla instances will be recreated at build time (files and databases), that mean Joomla! will get newly installed and removed in case of successful build
  • All Joomla! instances will be running with XAMPP, ideally on port not available to the outside world for security reasons

Make it Easy for Anyone to Get the Latest Executable

Successful build (Artifacts) are only available if build is successful. Team City provide this with less effort (configuration)

Everyone can see what's happening

  • A guest account will be available or a free public area with limited access to see the result of builds.
  • RSS feeds, emails and Instant messaging (Jabber) out of the box for end users or developers!

Automate Deployment

That will be, auto publish to some demo site in a configurable way. At the moment, at http://demo.waltercedric.com and http://demo2.waltercedric.com for me :-)

Final words

  • I will provide a ready to use package for Windows and Linux and all scripts, so anybody will be able to run it also on your own.
  • Critical part will be documented in my WIKI at http://wiki.waltercedric.com direct link HERE

It seem that nobody is providing such a package as I am after only one day at the top of search results in Google "continuous build joomla"

Tux Droid

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.

The mascot comes with a microphone and an infrared receiver, to perform a 2.4 GHz wireless full-duplex digital link between the USB dongle.

The Tux Droid also has a light sensor and a push button on top of the head. Its gestures cover e.g. eye- and wing-movements, while switch sensors in both wings are triggered by pushing the wings. For its sound output there is a volume control wheel to control a speaker and a 3.5mm stereo audio socket for audio out.

[WikiPedia]

 

 

My tux Droid has arrived 2 days ago.

Shortly here is a list of what I do not like

  • Noisy gearbox, compare to the Nabaztag, there is world in between.
  • 2.4GHZ but no WIFI, so it need always a running server. Hope the would develop a WIFI
  • Use Acapela voice engine, which should be the best on market, but voices are not really as clear as on the Nabaztag.
  • Less gadget, more in the 20 range.

And what I like a lot

  • Open source hardware and software,
  • Many programming language: Python, Java,
  • Easy to program gadget,
  • A lot more response feedback: yes, mouth, flaps, rotation.
  • Very good wiki, and online documentation
  • It look like TUX :-)

I did develop a Tux Droid plugin for TeamCity which is not far away from running and be distributed under GPL v3

Download the latest software go to the kysoh website.
Developers documentation visit our wiki.
For the forum go here.
For the trackers go here.
And for the community website go here.

Configuring TeamCity, Maven for PHP for Joomla continuous build

apache_maven

Doxygen phpDocumentator phpunit-logo teamcity512 maven4php

Maven for PHP uses the power of Maven for building, reporting on and creating documentations of PHP projects. It adapts the Maven build lifecycle to the PHP world while fully supporting PHP 4 and PHP 5. PHP for Maven uses PHPUnit for unit testing and doxygen for creating the api documentation.
Use a PHP library project to create a library that can be used by other PHP libraries or PHP web projects. Use a PHP web project to create a standalone web project.

So I quickly describe what I did install on my root server (OpenSuse 11.X)

My Objectives: being able to build all my Joomla! component using best agile development practices

“Specific tools and techniques such as continuous integration, automated or xUnit test, pair programming, test driven development, design patterns, domain-driven design, code refactoring and other techniques are often used to improve quality and enhance project agility.”

Read more: Configuring TeamCity, Maven for PHP for Joomla continuous build

Donations

Thank You for supporting my work