• Blog
  • En Twitter
  • Aprendiendo
  • Descubriendo
  • Disfrutando
  • Trabajando
  • Creando
    • Fotografías
  • Galerías
    • Ponferrada
  • Vídeos
    • Favoritos
    • Humor
    • Juegos
    • Música
    • Cine

Enlarge Image

ago
18
2011
 6

Installing Subversion and Jenkins in Ubuntu 11.04


I’m using Subversion to have versioning control of my automated test cases development. And I’m using Jenkins to schedule and execute those test cases.

If you are a tester (or you want to be one) or/and you don’t have many experience using Linux or with systems administration I hope this post helps you.

(For this guide I have used a clean installation of Ubuntu 11.04 in a Virtual Box machine with default settings)

1. Install Ubuntu: (default installation). “Next” to all ;-) . You can get it here.

2. Install necessary software: after installation finished, go to Applications > Ubuntu Software Center Go to “Get software“. Search and install these packages:

  • apache2
  • libapache2-svn
  • dconf Editor
  • subversion

3. Setting up Subversion (more info here):

3.1. Viewing all users (more info here):

  • Press Alt+F2, type “dconf-editor” and press Enter.
  • In the tree, locate “/apps/gnome-system-tools/users“.
  • Select the “showall” check-box. Close.

3.2. Setting up users

  • Choose System > Administration > Users and Groups from your Ubuntu menu.
  • Click the “Manage Groups” button.
  • Click the “Add” button.
  • Name the group “subversion“.
  • Add yourself and www-data (the Apache user) as users to this group.
  • Click “OK“, then click “Close” twice to commit your changes and exit the app.

3.3. Creating SVN repository

  • Go to “Applications > Accessories > Terminal” and type the following commands:
  • To create a folder for svn repository:

$ sudo mkdir /home/svn

$ cd /home/svn

$ sudo mkdir myproject

  • To create repository and setting up permissions properly:

$ sudo svnadmin create /home/svn/myproject

$ cd /home/svn

$ sudo chown -R www-data:subversion myproject

$ sudo chmod -R g+rws myproject

3.4. Accessing via WebDAV protocol (http://)

  • Type the following command to edit dav_svn.conf.

$ sudo gedit /etc/apache2/mods-available/dav_svn.conf

  • Paste this lines at the end of the file and save:
      <Location /svn>
         DAV svn
         SVNParentPath /home/svn
         SVNListParentPath On
         AuthType Basic
         AuthName "Subversion Repository"
         AuthUserFile /etc/subversion/passwd
         <LimitExcept GET PROPFIND OPTIONS REPORT>
            Require valid-user
         </LimitExcept>
      </Location>
  • Restart apache:

$ sudo /etc/init.d/apache2 restart

  • Creating a valid-user for svn:

sudo htpasswd -c /etc/subversion/passwd user_name

It prompts you to enter the password. Once you enter the password, the user is added. In our test automation environment, we will use this user and password to check out RIDE developed test cases via Tortoise client.

Now, you should be able to browse your SVN repository using your web browser from http://localhost/svn.

4. Installing Jenkins:

OPTION A: install Tomcat and deploy jenkins.war file. (This is the best option in order to be able to update Jenkins easily in the future without losing any of your configuration options, jobs…)

  • Install Tomcat: go to Applications > Ubuntu Software Center Go to “Get software“. Search and install these packages: tomcat6 and tomcat6-admin.
  • Add a user for managing Tomcat:

$ sudo gedit /etc/tomcat6/tomcat-users.xml

Edit file in order to get something like this and save:

<tomcat-users>
<role rolename=”admin”/>
<role rolename=”manager”/>
<user username=”desired-administrator-user-name” password=”desired-password” roles=”admin,manager”/>
</tomcat-users>

  • Restart tomcat:

$ sudo /etc/init.d/tomcat6 restart

  • Permissions: tomcat is going to deploy web applications by default in /usr/shared/tomcat6/.appname so what I do now (may be it is not the best solution, but it works) is to give tomcat6 group permissions and ownership of this folder:

$ sudo nautilus

(This is to open a file explorer with root rights)

Navigate to /usr/shared. Right click over tomcat6 folder and click on “Properties“. Go to “Permissions” tab and set group permissions to “tomcat6″ and give “Create and delete files” access.

  • Deploying Jenkins:
  1. Download last jenkins.war package from http://jenkins-ci.org.
  2. Go to http://localhosts:8080/manager/html. Type your tomcat user and password info and log in.
  3. Go to “Deploy” section and browse for the previously downloaded jenkins.war file. Click on “Deploy”.
  4. Done! Now you should be able to access Jenkins from http://localhost:8080/jenkins.
  5. To upgrade new versions of Jenkins the only thing we will have to do is Undeploy /jenkins application and Deploy new jenkins.war file again.

NOTE: if you are planning to execute your testing over Windows machines, you can be interested in this post: Configuring Jenkins.

OPTION B: direct installation of Ubuntu native package

  • Download last native package for Ubuntu/Debian from http://jenkins-ci.org/.
  • Install it.
  • Done! Now you should be able to access Jenkins from http://localhost:8080.

NOTE: if you are planning to execute your testing over Windows machines, you can be interested in this post: Configuring Jenkins.

6 Comments for Installing Subversion and Jenkins in Ubuntu 11.04


Configuring machines as Hudson nodes | The Blojo Times
August 22, 2011, 9:43 am

[...] Remember that you can read this previous post for a guide to install Hudson in Ubuntu. [...]


Reply

Adding Windows machines as Jenkins nodes (slaves) | The Blojo Times
August 25, 2011, 1:21 pm

[...] that you can read this previous post for a guide to install Jenkins in Ubuntu. And this little guide for configuring [...]


Reply

Configuring Jenkins in Ubuntu 11.04 | The Blojo Times
August 25, 2011, 2:10 pm

[...] NOTE: here you have a guide to install Jenkins in Ubuntu 11.04. [...]


Reply

Blojo Reloaded » Deploying an Automation environment for Software Testing
January 30, 2012, 8:45 am

[...] I use Subversion for control test cases versions; and Jenkins for schedule and review results of test cases executions. I have both installed in an Ubuntu 11.04 machine. I wrote an INSTALLATION GUIDE for this in a previous post. [...]


Reply

Blojo Reloaded » Configuring Jenkins in Ubuntu 11.04
January 30, 2012, 1:24 pm

[...] NOTE: here you have a guide to install Jenkins in Ubuntu 11.04. [...]


Reply

Blojo Reloaded » Adding Windows machines as Jenkins nodes (slaves)
January 30, 2012, 1:26 pm

[...] that you can read this previous post for a guide to install Jenkins in Ubuntu. And this little guide for configuring [...]


Reply



Leave A Reply





  Cancel Reply

  • Categorías

    • Aprendiendo (44)
    • Blojo (152)
    • Creando (2)
    • Descubriendo (2)
    • Disfrutando (4)
    • Trabajando (10)





Blojo v3.4 | Proudly Powered by Camelot Fields