Bitnami Jenkins

    Jenkins, previously known as Hudson, is an open source continuous integration server. Built with Java, it provides over 400 plugins to support building and testing virtually any project. It supports SCM tools including CVS, Subversion, Git, Mercurial, Perforce and Clearcase, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. It also can monitor executions of remote tasks.

    Please, take a look to the Quick Start Guide to know the basic use of this Stack.

    How to start/stop the servers?

    You can use either the graphical manager tool or the command-line tool to start and stop the servers.

    Graphical Tool

    Bitnami stacks include a graphical tool to manage the servers easily (native installers only). Using this tool, you can start, stop and restart the servers and check the log files.

    manager-servers.png

     

     

     

     

     

     

     

     

     

     

    On Windows:

    • Double-click the "manager-windows.exe" file in your installation directory.  
    • You can also start the Manager tool using the Start Menu path Start -> Program Files -> Bitnami Stack -> Manager.

    On Linux and Mac OS X:

    • Double-click the "manager-osx" or "manager-linux-*" tool in your installation directory. 
    Command-line Tool

    Each Bitnami stack includes a control script that lets you easily stop, start and restart servers. Refer to the section for your platform to learn more.

    Cloud Server

    The script is located at /opt/bitnami/ctlscript.sh. Call it without any arguments to restart all services:

    $ sudo /opt/bitnami/ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ sudo /opt/bitnami/ctlscript.sh restart mysql
    

    Virtual Machine

    The script is located at /opt/bitnami/ctlscript.sh. Call it without any arguments to restart all services:

    $ sudo /opt/bitnami/ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ sudo /opt/bitnami/ctlscript.sh restart mysql
    

    Native Installer

    The control script is only available for Linux and Mac OS X native installers. The script is located in your installation directory and named ctlscript.sh. Call it without any arguments to restart all services.

    On Linux:
    If your installation directory is /home/USER/wordpress-4.0.1-0, call the control script with the ‘start’ argument to start all servers. For example:

    $ cd /home/USER/wordpress-4.0.1-0
    $ ./ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ cd /home/USER/wordpress-4.0.1-0
    $ ./ctlscript.sh restart mysql
    

    On Mac OS X:
    If your installation directory is /Applications/wordpress-4.0.1-0, call the control script with the ‘start’ argument to start all servers. For example:

    $ cd /Applications/wordpress-4.0.1-0
    $ ./ctlscript.sh start
    

    Or use it to restart a specific service only by passing the service name as argument - for example 'mysql':

    $ cd /Applications/wordpress-4.0.1-0
    $ ./ctlscript.sh restart mysql
    

    Tabs end

    Where is JENKINS_HOME variable pointing to?

    We define JENKINS_HOME in your installation directory in the apache-tomcat/conf/Catalina/localhost/jenkins.xml file. By default it is pointing to apps/jenkins/jenkins_home.

    Notice that the installation directory is /opt/bitnami in the Bitnami virtual appliances and Bitnami Amazon Images.

    How to start with Git and Jenkins?

    Jenkins application is running as "tomcat" user so it is necessary to configure this user in case you want to access to a private repository. If you use a public repository is not necessary to configure the Tomcat user.

    Configure Tomcat user to have access to the Git repository

    Previous versions of Jenkins require to create the Tomcat user folder:

    $ sudo mkdir /home/tomcat
    $ sudo mkdir /home/tomcat/.ssh
    

    Then copy the private key to access to the repository into the "/home/tomcat/.ssh" folder:

    $ sudo cp /path/to/id_rsa /home/tomcat/.ssh

    And change the permissions

    $ sudo chown -R tomcat:tomcat /home/tomcat

    It is also necessary to save the hostname of your repository into the "known_hosts" file:

    $ sudo su tomcat -c "/opt/bitnami/git/bin/git ls-remote -h git@YOUR_REPOSITORY.git HEAD"
    The authenticity of host 'ec2-xx-yy-zz.compute-1.amazonaws.com (xx.yy.zz)' can't be established. 
    ECDSA key fingerprint is e5:xx:9d:yy:ff:89:55:47:aa:fd:b5:ee:0a:pp:6f:8d.
    Are you sure you want to continue connecting (yes/no)? yes
    Configure Git repository in Jenkins 

    Before creating the first Job, it is necessary to configure the Git user and email that Jenkins will use to clone the repository. You can configure these options in "Manage Jenkins" -> "Configure System" -> "Git plugin" section

    configuring-jenkins-git-2a.jpg

    Then create a new Job in Jenkins and specify the Git repository.

    create-job-jenkins-3.jpg

    And run the Build. If everything was properly configured, Jenkins will checkout the code from the Git repository.

     

    How to upgrade Jenkins?

    If you want to upgrade Jenkins keeping your data, you just need to download the latest jenkins.war file, copy it in your apache-tomcat/webapps directory and restart Tomcat. It is recommended to create a backup of the previous jenkins.war file. You may want to revert to the previous version if you find any issues after upgrading.

    Upgrading only Jenkins

    On Linux and OSX you can execute the following steps to perform the above (notice that the installation directory is /opt/bitnami in the Bitnami virtual appliances and Bitnami Amazon Images):
     

    $ cd <installation_directory>

    ## Stop the server

    $ ./ctlscript.sh stop
     
    ## Copy your previous .war file in case you need to restore it
    $ cp apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
     
    ## Remove jenkins all files to force Tomcat to deploy the new jenkins.war file
    $ rm -r apache-tomcat/webapps/jenkins
    $ rm -r apache-tomcat/webapps/jenkins.war
    $ rm -r apache-tomcat/work/Catalina/localhost/jenkins
     
    ## Donwload the new version of jenkins
    $ mv jenkins.war apache-tomcat/webapps/
     
    ## Start the server
    $ ./ctlscript.sh start

    On Windows you can stop the servers from the Start Menu entry or using the graphical tool that you can find in your installation directory. Using the file explorer go to where you installed the Bitnami Jenkins Stack. Copy the jenkins.war file from the apache-tomcat/webapps directory to apps/jenkins. Download the latest jenkins.war file and copy it in apache-tomcat/webapps. Now just start the server from the Start Menu or using the graphical tool.

    Upgrading all the components

    Alternatively to the process above, you can download a new Bitnami Jenkins Stack. You can install it to a different location (remember to stop the previous install so there are no port conflicts) and point it to your previous JENKINS_HOME path by editing the file  apache-tomcat/conf/Catalina/localhost/jenkins.xml.

    If you are using a Bitnami virtual appliance or AMI you can start a new image with the latest jenkins version and move the content of /opt/bitnami/apps/jenkins/jenkins_home in your current installation to the new installation. Then restart the server.

    How to enable SSL in Jenkins?

    You can configure Apache Tomcat to enable SSL connections for accessing to the application using the HTTPS protocol. It is necessary to specify the Apache SSL certificate. If you do not have the cert you can create following these steps in the section below.

    Check that you have the certificate file at "/installdir/apache-tomcat/conf/ssl/tomcat.cert.pem" and the certificate key file at "/installdir/apache-tomcat/conf/ssl/tomcat.key.pem".

    To enable SSL you should uncomment the following line in the /installdir/apache-tomcat/conf/server.xml file:

    <Connector port="8443"
                   protocol="HTTP/1.1" SSLEnabled="true"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true"
                   clientAuth="false" sslProtocol="TLS"
                   keystoreFile="conf/myKeystore"
                   keystorePass="your_password"
                   SSLCertificateFile="installdir/apache-tomcat/conf/ssl/tomcat.cert.pem"
                   SSLCertificateKeyFile="installdir/apache-tomcat/conf/ssl/tomcat.key.pem"/>
    

    Then restart the Apache server and try to access at "https://localhost:8443".

    How to create a SSL certificate for Jenkins?

    You can find a detailed guide in the official Apache Tomcat documentation at http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

    Tag page (Edit tags)
    • No tags
    Page statistics
    47626 view(s), 14 edit(s) and 9252 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments