← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #207756]: Can I use Jenkins with Sikuli?

 

Question #207756 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/207756

    Status: Open => Answered

j proposed the following answer:
@RayMan maybe you could add this to your FAQ
@ironmantis7x

Step 1.
Install Sikuli on your remote System and make sure it works. You have to be able to run a sikuli script from command line. You run a sikuli script from command line like this:
- Open terminal
- Change to directory containing the sikulifile: type "cd dir\to\file" without the quotes. 
- type "C:\path\to\sikuliinstallation\sikuli-ide.bat -r myscript.sikuli" without the quotes. 
If everything is installed correctly, the sikuliscript should execute now. 

Step 2.
If you have not done it already, create a jenkins node which will trigger the sikuli script.
- Go to your jenkins: http://your-jenkins.com/computer/
- Klick new node and select dumb slave, give the node any name and click ok
- On the next page, configure the rest of the settings needed for the slave. I'm not going into detail here because this has nothing to do with sikuli and depends on your remote system. If you don't understand this part, please read the jenkins guide. The only important thing is to give the node a unique label. 

Step 3.
- In the node list, search for your newly created node and click on it to open it
- click the button to start the slave agent. The slave agent is a java program that has to run on your remote system which will run the sikuli scripts. Again, if this does not work, please try to find help in the jenkins community as this is not a sikuli matter and I'm no jenkins expert. 
- If the slave agent is started and connected to jenkins successfully, it should say so in the slave detail view http://your-jenkins.com/computer/yournodename/

Step 4. 
In Jenkins, create a new job by clicking the "create new job" link in the left menu in the project overview.
- Choose freestyle project as project type
- On the next page, choose a name and select the checkbox where you can specify on which labels the build may run (don't know the english name of this setting because I use the german version). Enter the label you gave the new node previously

Step 5. 
Make jenkins run sikuli:
- Click the "add build step" dropdown and select the windows batch script option
- In the new textarea you can specify your batch script. It sould look like this:
cd C:\path\to\sikulifile\
C:\path\to\sikuliinstallation\sikuli-ide.bat -r myscript.sikuli
- Now you can click "apply"

Step 6. 
If you now run the created job, the jenkins slave that runs on the remote system should run the batch file and therefore run the sikuli script. 

This is only a very basic guide as jenkins is a very complex software.
Of course you can add more build steps, check out code before running
the script or any other thing you want to do with jenkins.

I hope this guide was clear enough, however if you have still questions,
feel free to ask them. I can't help too much with questions about
jenkins, though, because I don't use it that often.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.