Jump to content

Integrating Plastic SCM with Hudson


Zia

Recommended Posts

Hi Zia,

I'm checking with the team. I recall several users are integrating with Hudson most likely using really easy scripting, but I'll come back with the details.

What we do with NAnt, for instance (not the same thing, I know) is just run a "cm" command (our command line) inside an "exec" block.

I guess these customers are doing the same but I need to check.

With CruiseControl we've our own plugin but at the end of the day is something very similar to a "exec" thing.

With FinalBuilder and Pulse the story is different because they're much more complex in terms of functionalities and big integrations were made there.

pablo

Link to comment
Share on other sites

Hi Zia' date='

I'm checking with the team. I recall several users are integrating with Hudson most likely using really easy scripting, but I'll come back with the details.[/quote']

Yes, I'm also interested in this.

http://www.plasticscm.com/features/third-party-integrations.aspx

CI build systems

These well-known Build Servers are also supported out of the box:

Cruise Control

Final Builder

Pulse

Hudson

Cruzible (to be delivered yet)

Sense of "supported out of the box" is a little bit unclear.

Link to comment
Share on other sites

Hi, all:

To run Plastic SCM commands from Hudson, you have to do the following:

1.- Create a new job of type "Build a free-style software project".

2.- In the Build section, click on Add build step -> Execute shell. Here you can state any command. In our case let's suppose: "cm update ."

3.- Now, in the Advanced Project Options, click on Advanced, select the Use custom workspace option and type your Plastic SCM workspace path.

4.- Save & Run.

Clicking on the recently build item, you will be able to see the console output and check the results.

Also, it is possible to check Plastic SCM commands in Groovy from the Dashboard, Manage Hudson and finally Script Console. The following is an example:

def command = "cm help"

def proc = command.execute()

proc.waitFor()

println "stdout: ${proc.in.text}"

Link to comment
Share on other sites

Thank you for the information. I am new to this so let me ask you one more question. Will this setup automate the build? What I mean by that is that the check-in activity should activate build process on Hudson. Can this be accomplished by this setup?

Link to comment
Share on other sites

Hi, Zia:

To accomplish that you can try the following:

Create a trigger after checkin (client or server) and include as script a Python script. The following is an example:

cm maketrigger after-checkin "PostCheckinBuild" "/usr/bin/python script.py" --position=1

The script will launch the build process. Hudson provides an API to launch builds automatically in Python. Look at the following link about how to do this:

http://wiki.hudson-ci.org/display/HUDSON/Remote+access+API

More information about Plastic SCM triggers here:

http://www.plasticscm.com/releases/3.0.1/manuals-html/en/triggerguide.htm

If you use a server trigger, the path provided to the script is a server path. If you use a client trigger, the path provided must be a client path. I think that the best idea is to use a server trigger, so that every user can use the trigger, since it is defined on the server side.

If you have any further questions, don't hesitate to ask us.

Best,

Luis

Link to comment
Share on other sites

  • 3 weeks later...

Why wait! I know you guys are eager to test the plugin and give us feedback, remember it is a beta:

Attached is the file: plasticscm.hpi , zipped, which is basically the Plastic SCM plugin for Hudson CI.

1- Just copy the hpi file into .hudson/plugins, restart the server, and it should work.

2- Setup up a project and choose Plastic SCM as the Source Code Management.

3- Insert the Selector for your active Plastic SCM workspace in the selector window of Hudson.

You can get the selector of your active Plastic workspace by CD /your_plastic_workspace_path/

execute the command: cm showselector for the lazy people cm ss

4- Your selector could look like this:

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

Thats all! the rest is to schedule you Continues builds in Hudson as you normally do.

Feedbacks are welcomed with open arms!

Enjoy,

Miller

plasticscm.zip

Link to comment
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...