ControlTier CI Loop

From ControlTier

Jump to: navigation, search

Setting up the ControlTier Continuous Integration Build

Contents

Assumptions:

JAVA_HOME=/usr/lib/jvm/java-1.6.0 as a result of the installation of rundeck and we will be using this java for building, running Jenkins, and running Rundeck

This CI Environment will be using Jenkins for the Continuous Integration.

rundeck documentation will be added for further automation with respect to the ControlTier release to SourceForge


Install rundeck (from the downloads):

[root@build ~]# rpm -Uvh http://rundeck.org/latest.rpm
Retrieving http://rundeck.org/latest.rpm
Preparing...                ########################################### [100%]
   1:rundeck-repo           ########################################### [100%]

[root@build ~]# yum install -y rundeck
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rundeck.noarch 0:1.2.0-0.43 set to be updated
--> Processing Dependency: rundeck-config for package: rundeck
--> Running transaction check
---> Package rundeck-config.noarch 0:1.2.0-0.43 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================
 Package                                          Arch                                     Version                                       Repository                                         Size
=================================================================================================================================================================================================
Installing:
 rundeck                                          noarch                                   1.2.0-0.43                                    rundeck-release                                    44 M
Installing for dependencies:
 rundeck-config                                   noarch                                   1.2.0-0.43                                    rundeck-release                                   7.4 k

Transaction Summary
=================================================================================================================================================================================================
Install      2 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 44 M
Downloading Packages:
(1/2): rundeck-config-1.2.0-0.43.noarch.rpm                                                                                                                               | 7.4 kB     00:00     
(2/2): rundeck-1.2.0-0.43.noarch.rpm                                                                                                                                      |  44 MB     00:07     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                            5.7 MB/s |  44 MB     00:07     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : rundeck                                                                                                                                                                   1/2 
  Installing     : rundeck-config                                                                                                                                                            2/2 

Installed:
  rundeck.noarch 0:1.2.0-0.43                                                                                                                                                                    

Dependency Installed:
  rundeck-config.noarch 0:1.2.0-0.43                                                                                                                                                             

Complete!

[[root@build ~]# usermod -G root,wheel rundeck
[root@build ~]# groups rundeck
rundeck : rundeck root wheel
[root@build ~]# grep ^%wheel /etc/sudoers
%wheel	ALL=(ALL)	NOPASSWD: ALL
[root@build ~]# chmod 440  /etc/shadow
[root@build ~]# su - rundeck
[rundeck@build ~]$ sudo id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

[rundeck@build ~]$ ssh-keygen -t dsa -N ''
Generating public/private dsa key pair.
Enter file in which to save the key (/home/rundeck/.ssh/id_dsa): 
Your identification has been saved in /home/rundeck/.ssh/id_dsa.
Your public key has been saved in /home/rundeck/.ssh/id_dsa.pub.
The key fingerprint is:
5c:bf:e9:6e:2b:19:54:c8:62:64:6f:a8:ed:38:e1:1c rundeck@build.ctier.dtosolutions.com

Install Jenkins using the redhat rpm (from the jenkins downloads):

[rundeck@build ~]$ wget -O /tmp/jenkins.rpm http://jenkins-ci.org/latest/redhat/jenkins-1.403-1.1.noarch.rpm
--2011-03-24 13:23:36--  http://jenkins-ci.org/latest/redhat/jenkins.rpm
Resolving jenkins-ci.org... 192.18.49.133
Connecting to jenkins-ci.org|192.18.49.133|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://jenkins-ci.org/downloads/redhat/jenkins-1.403-1.1.noarch.rpm [following]
--2011-03-24 13:23:37--  http://jenkins-ci.org/downloads/redhat/jenkins-1.403-1.1.noarch.rpm
Connecting to jenkins-ci.org|192.18.49.133|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 38821047 (37M) [text/plain]
Saving to: `/tmp/jenkins.rpm'

100%[=======================================================================================================================================================>] 38,821,047   962K/s   in 40s     

2011-03-24 13:24:16 (957 KB/s) - `/tmp/jenkins.rpm' saved [38821047/38821047]

[rundeck@build ~]$ rpm -qp /tmp/jenkins.rpm 
jenkins-1.403-1.1

[rundeck@build ~]$ sudo rpm -i /tmp/jenkins.rpm

[rundeck@build ~]$ sudo vi /etc/sysconfig/jenkins 
[rundeck@build ~]$ sudo grep JENKINS_USER /etc/sysconfig/jenkins
JENKINS_USER="rundeck"
[rundeck@build ~]$ sudo chown -R rundeck:rundeck /var/lib/jenkins
[rundeck@build ~]$ sudo chown -R rundeck:rundeck /var/log/jenkins

[root@build lib]# pwd
/var/lib
[root@build lib]# mv jenkins /mnt
[root@build lib]# ln -s /mnt/jenkins 

[rundeck@build ~]$ sudo /etc/rc.d/init.d/jenkins start
Starting Jenkins                                            [  OK  ]

hudsonConfigureSecurity
[rundeck@build ~]$ sudo /usr/sbin/useradd chuck
[rundeck@build ~]$ sudo passwd chuck
Changing password for user chuck.
New UNIX password: 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.

hudsonLoginPage exampleUserLoggedIn

Configure CI jobs:

Refer to the jenkins utility script loadHudsonJob.sh which automates jobs in jenkins config xml format Additionally, refer to the config xml files in hudson ci where the following config xml files are:

ControlTier-3.6.1.zip.config.xml
ControlTier-3.6.1-client.rpm.config.xml	
ControlTier-3.6.1-server.rpm.config.xml
[chuck@build controltier-3-6-support chuck]$ cat ControlTier-3.6.1.zip.config.xml | ./loadJob.sh  ControlTier-3.6.1.zip chuck myPassword
[chuck@build controltier-3-6-support chuck]$ cat ControlTier-3.6.1-client.rpm.config.xml  | ./loadJob.sh  ControlTier-3.6.1-client.rpm  chuck myPassword
[chuck@build controltier-3-6-support chuck]$ cat ControlTier-3.6.1-server.rpm.config.xml  | ./loadJob.sh  ControlTier-3.6.1-server.rpm  chuck myPassword

hudsonJobsLoaded

Personal tools
Namespaces
Variants
Actions
Navigation
Communication
Development
Toolbox
Print/export