Plastic SCM Plug-in for Hudson CI

Thursday, December 23, 2010 2 Comments

In this blog post we will go through the very basic steps to setup Plastic SCM Plug in for Hudson CI and do some builds.

The Plastic SCM plug in developed for Hudson CI is basically an .hpi file which will be included in the HUDSON repository (working on it).

However, you can download the plug in from this link: Download_PlasticSCM_Plugin_for_Hudson
Just unzip the hpi file into .hudson/plugins, restart the server, and it should work.
For this Blog post my setup involves the following software:
  • OpenSuse 11.1_x86

  • Plastic SCM version 3.0.187.22

  • Hudson CI ver. 1.384 (also tried it with 1.398)

  • gcc-c++ ver. 4.3 (use it for compiling the Hello World sample with Hudson)

  • Test files you can download from this link: Download_Test_Files

Create a Plastic workspace and extract the test files into the directory of the workspace.
The test files are basically two files, a helloworld.cpp and a script file BuildHello that calls the g++ compiler and compiles helloworld.cpp. Add the files to Plastic SCM so they are controlled, as illustrated in figure1.



Figure 1


Now into Hudson:
Log into Hudson, in my setup: http://localhost:8080/

Navigate to Manage Hudson-->Manage plugins-->Installed (choose Installed Tab)
Illustrated in figure2



Figure 2

Plastic SCM Plug in should be in the list and enabled. (double checking here :-))
Plastic SCM plug in does not differ much from the other Hudson Plug ins, so let us create a project and do some builds.
  • New Job-->Job name: PlasticSCM_prj1-->Build a free-style software project-->OK

Illustrated on figure 3



Figure 3


  • Next page we will configure Source Code Managment-->Plastic SCM-->Selector (Insert Plastic SCM workspace selector, fig 4+5)

    • Selector can be obtained by many ways, this is just one of them.

    • CD to your workspace directory ex.cd \millerwks\prj1\

    • execute cm showselector (cm ss) ex. \millerwks\prj1\cm ss

    • Selector will be printed and could look like this example:


repository "default"
path "/"
br "/main"
co "/main"


  • On the same page under the Build-->Execute shell-->Command (Insert the name of the shell script BuildHello, fig 6)

  • Save
Illustrated in the next figures



Figure 4



Figure 5



Figure 6


And now we are ready to do a "manual build" without triggers, so go ahead and push the button Build Now as indicated in fig 7.



Figure 7


Well, after pushing the Build Now (for many times), I get Build failed which is not cool! lets try to find out what is causing the failing of this build.
In the Build History on the left I entered into the latest build, and clicked on Concole Output. see fig 8.



Figure 8


Ok, cannot find the build script Buildhello, checking figure 1 with figure 6, I inserted the name of the script wrongly, Buildhello instead of the correct BuildHello. So I go to the configuration of the project within Hudson and fix the name, as in fig 9.



Figure 9


A manual build now and things looks much better, fig 10 + 11



Figure 10



Figure 11


And it is by time we try if our hello program built correctly as illustrated in fig 12.




Figure 12


2 comments:

  1. Running Hudson/Jenkins on a Windows server, is there a way to have it use the PlasticSCM client without running the Jenkins service as a user that has setup the PlasticSCM client? I run the service as LocalSystem and it's giving me an error about the client not being configured. Obviously, you can't login and setup the client as LocalSystem.

    ReplyDelete
  2. indeed, when I wrote this post I used linux. to make your hudson/jenkins work with localuser account in windows server, just Copy
    C:\Users\LoggedInUser\AppData\Local\plastic\client.conf
    to
    C:\Windows\system32\config\systemprofile\AppData\Local\plastic\client.conf

    your builds should run fine now.
    cheers,
    Miller

    ReplyDelete