{"id":46566,"date":"2014-06-18T19:50:35","date_gmt":"2014-06-18T16:50:35","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=46566"},"modified":"2019-09-10T14:49:24","modified_gmt":"2019-09-10T11:49:24","slug":"how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/","title":{"rendered":"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery"},"content":{"rendered":"<p>Continuous integration (CI) allows for pushing regular enhancements and bug fixes to your application in an easy, fast, and safe way. When using this practice, every time a developer commits a change, the software has to pass a number of tests. This guarantees that every new release is safe and bug-free. Ultimately, continuous integration can help to automate the entire software delivery process.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-46567 aligncenter\" alt=\"\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/09\/Continuous_Delivery_process_diagram.png\" width=\"585\" height=\"419\" \/><small>Software delivery process based on the continuous integration strategy (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Continuous_delivery\" rel=\"noopener noreferrer\" target=\"_blank\">Image credit<\/a>)<\/small><\/center><\/p>\n<p>In this blog post, we will explain in detail how to set up continuous delivery for a Ruby on Rails (RoR) application running on the Cloud Foundry PaaS with <a href=\"https:\/\/www.altoros.com\/blog\/continuous-integration-with-jenkins-and-travis-ci\/\">Jenkins CI<\/a>, a popular continuous integration tool.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Infrastructure_and_setup\" >Infrastructure and setup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Setting_up_a_remote_system\" >Setting up a remote system<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Setting_up_an_RVM\" >Setting up an RVM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Configuring_Jenkins_CI\" >Configuring Jenkins CI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#MySQL_configuration_on_a_local_machine\" >MySQL configuration on a local machine<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Examples\" >Examples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#Further_reading\" >Further reading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#About_the_author\" >About the author<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Infrastructure_and_setup\"><\/span>Infrastructure and setup<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For this tutorial, we used a simple RoR application with MySQL as a database. Then, we pushed the code to a public GitHub repository. The local workstation had the following specs: Ubuntu 13.10 x86_64 with MySQL Server 5.5.35. The remote virtual machine ran Ubuntu 10.04 x86_64 with Cloud Foundry v2 (5.4.5), Jenkins 1.550, and a MySQL client (5.1.73).<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/continuous-delivery-pipeline-with-jenkins-on-cloud-foundry.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/continuous-delivery-pipeline-with-jenkins-on-cloud-foundry.png\" alt=\"\" width=\"524\" height=\"444\" class=\"aligncenter size-full wp-image-46576\" \/><\/a><small>Pushing a Jenkins CI app to Cloud Foundry<\/small><\/center><\/p>\n<p>So, let\u2019s begin.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Setting_up_a_remote_system\"><\/span>Setting up a remote system<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before you start, install <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Openssh-server<\/code> (optional).<\/p>\n<pre style=\"padding-left: 30px;\">sudo apt-get install openssh-server<\/pre>\n<p>Then, install the latest stable Git from a PPA (Personal Package Archive), since the default Git version (1.7.0.4 for Ubuntu 10.04) is a bit of outdated.<\/p>\n<pre style=\"padding-left: 30px;\">sudo apt-get install python-software-properties\r\nsudo add-apt-repository ppa:git-core\/ppa\r\nsudo apt-get update\r\nsudo apt-get install git<\/pre>\n<p>Configure Git.<\/p>\n<pre style=\"padding-left: 30px;\">git config --global user.name \u201cjenkins\u201d\r\ngit config --global user.email \u201cjenkins@example.com\"<\/pre>\n<p>Configure <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">iptables<\/code>. Under this step, you also need to:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\">enable an outbound connection on the remote machine to access the database on the workstation\n<pre style=\"padding-left: 30px;\">sudo iptables -A OUTPUT -p tcp -d database_host_ip --dport 3306 -j ACCEPT<\/pre>\n<\/li>\n<li style=\"margin-bottom: 6px;\">save the updated <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">iptables<\/code> rules to a file\n<pre style=\"padding-left: 30px;\">iptables-save &gt; \/etc\/iptables.rules<\/pre>\n<\/li>\n<li style=\"margin-bottom: 6px;\">make sure the rules are restored at every boot\n<pre style=\"padding-left: 30px;\">vim \/etc\/network\/if-post-down.d\/loadiptables\r\n\r\n#!\/bin\/bash\r\n \/sbin\/iptables-restore &lt; \/etc\/iptables.rules\r\nexit 0<\/pre>\n<\/li>\n<\/ul>\n<p>Install RVM pre-requisites under Jenkins on the remote machine.<\/p>\n<pre style=\"padding-left: 30px;\">sudo apt-get install curl libxslt1.1 libxslt-dev xvfb build-essential zlibc zlib1g zlib1g-dev bison openssl libreadline5 libreadline-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev subversion autoconf libtool<\/pre>\n<p>Install Cloud Foundry. Under this step, proceed with the following instructions:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\">You can use the Cloud Foundry v2 Nise Installer.\n<pre style=\"padding-left: 30px;\">bash &lt; &lt;(curl -s -k -B https:\/\/raw.github.com\/yudai\/cf_nise_installer\/${INSTALLER_BRANCH:-master}\/local\/bootstrap.sh)<\/pre>\n<\/li>\n<li style=\"margin-bottom: 6px;\">Then, restart your devbox.<\/li>\n<li style=\"margin-bottom: 6px;\">Launch Cloud Foundry.\n<pre style=\"padding-left: 30px;\">cd cf_nise_installer\r\n.\/local\/start_processes.sh<\/pre>\n<\/li>\n<li style=\"margin-bottom: 6px;\">After this command, wait a couple of minutes to allow all the processes to start.<\/li>\n<li style=\"margin-bottom: 6px;\">Create an organization and space in Cloud Foundry, please follow the same order of commands.\n<pre style=\"padding-left: 30px;\">cf api http:\/\/api.192.168.1.180.xip.io <span style=\"color: #0000ff;\"># api..xip.io<\/span>\r\ncf login -u admin -p c1oudc0w <span style=\"color: #0000ff;\">#credentials provided by cf installation tutorial, see references<\/span>\r\ncf create-org altoros <span style=\"color: #0000ff;\">#enter your value<\/span>\r\ncf create-space -o altoros development <span style=\"color: #0000ff;\">#enter your value<\/span>\r\ncf target -o altoros -s development<\/pre>\n<\/li>\n<li>Finally, add the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">.manifest.yml<\/code> file for the application to your RoR project directory (see the \u201cExamples\u201d section).<\/li>\n<\/ul>\n<p>Now, it&#8217;s time to install Jenkins. For this purpose, follow the next steps:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\">Install <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">openjdk-6-jre<\/code> and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">openjdk-6-jdk<\/code>\n<pre style=\"padding-left: 30px;\">sudo apt-get install openjdk-6-jdk openjdk-6-jre<\/pre>\n<\/li>\n<li style=\"margin-bottom: 6px;\">Install the latest version of Jenkins\n<pre style=\"padding-left: 30px;\">wget -q -O - http:\/\/pkg.jenkins-ci.org\/debian\/jenkins-ci.org.key | sudo apt-key add -\r\nsudo sh -c 'echo deb http:\/\/pkg.jenkins-ci.org\/debian binary\/ &gt; \/etc\/apt\/sources.list.d\/jenkins.list'\r\nsudo apt-get update\r\nsudo apt-get install jenkins<\/pre>\n<\/li>\n<li>Install a MySQL client\n<pre style=\"padding-left: 30px;\">sudo apt-get install mysql-client-core-5.1<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Setting_up_an_RVM\"><\/span>Setting up an RVM<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Switch to the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">jenkins<\/code> account.<\/p>\n<pre style=\"padding-left: 30px;\">sudo su Jenkins<\/pre>\n<p>Install RVM for the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">jenkins<\/code> user.<\/p>\n<blockquote><p>Important: DO NOT install RVM under the same account where you installed Cloud Foundry to avoid conflicting with RBenv.<\/p><\/blockquote>\n<pre style=\"padding-left: 30px;\">cd ~\r\n\\curl -sSL https:\/\/get.rvm.io | bash -s stable<\/pre>\n<p>Install Ruby 1.9.3 or 2.x.0 according to your project settings.<\/p>\n<pre style=\"padding-left: 30px;\">source ~\/.bash_profile\r\nrvm autolibs disable\r\nrvm install 1.9.3<\/pre>\n<p>Create the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf2<\/code> gemset.<\/p>\n<pre style=\"padding-left: 30px;\">\r\nrvm use 1.9.3\r\nrvm gemset create cf2\r\nrvm gemset use ruby-1.9.3-p484@cf2\r\n<\/pre>\n<p>Download and install the Cloud Foundry CLI from <a href=\"https:\/\/github.com\/cloudfoundry\/cli\/releases\" rel=\"noopener noreferrer\" target=\"_blank\">this GitHub repo<\/a>.<\/p>\n<pre style=\"padding-left: 30px;\">\r\nwget -O cf.deb https:\/\/s3.amazonaws.com\/go-cli\/releases\/v6.1.2\/cf-cli_amd64.deb\r\nsudo dpkg -i cf.deb\r\n<\/pre>\n<p><strong>Note:<\/strong> Currently, the latest version of Cloud Foundry CLI utility is v6.1.2. This may change in the future.<\/p>\n<p>Generate a new SSH key and add it to GitHub.<\/p>\n<pre style=\"padding-left: 30px;\">\r\ncd ~\r\nmkdir .ssh\r\ncd .ssh\r\nssh-keygen -t rsa -C \"jenkins@example.com\"\r\n<\/pre>\n<p>Copy the public key to the appropriate settings tab of your GitHub account.<\/p>\n<p>Finally, verify that everything worked out as expected.<\/p>\n<pre style=\"padding-left: 30px;\">\r\nssh -T git@github.com\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Configuring_Jenkins_CI\"><\/span>Configuring Jenkins CI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>First, you need to add environment variables to Jenkins. To do this, go to: <em>Manage Jenkins -> Configure System -> Global properties\/Environment variables<\/em> and fill out the following fields:<\/p>\n<ul>\n<li style=\"margin-bottom: 6px;\">login: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">admin<\/code> (provided in the Cloud Foundry installation tutorial, see the \u201cReferences\u201d section)<\/li>\n<li style=\"margin-bottom: 6px;\">org: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">altoros<\/code> (created previously in the Install Cloud Foundry step)<\/li>\n<li style=\"margin-bottom: 6px;\">password: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">c1oudc0w<\/code> (provided by in the Cloud Foundry installation tutorial, see the \u201cReferences\u201d section)<\/li>\n<li style=\"margin-bottom: 6px;\">space: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">development<\/code> (created previously in the Install Cloud Foundry step)<\/li>\n<li>target: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">http:\/\/api.Address.xip.io<\/code> (provided in the Cloud Foundry installation tutorial, see the \u201cReferences\u201d section)<\/li>\n<\/ul>\n<p>Install the following Jenkins plugins: Git Client, GitHub, and Rake.<\/p>\n<p>Configure Jenkins security by adding accounts with appropriate permissions.<\/p>\n<p>Create a new Jenkins project. To do this, fill out the fields related to the GitHub project. Then, enter build steps into the <em>Execute shell<\/em> field (see the \u201cExamples section\u201d).<\/p>\n<p>Add config files to the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">JENKINS_HOME\/shared<\/code> folder.<\/p>\n<pre style=\"padding-left: 30px;\">\r\ncd JENKINS_HOME\r\nmkdir shared\r\ncd shared\r\nvim manifest.yml (see the \u201cExamples\u201d section)\r\nvim database.yml\r\n<\/pre>\n<p>Since both Cloud Foundry and Jenkins were installed on the same machine in our setup, we had to assign free port 8081 to Jenkins to avoid conflict with Cloud Foundry. Edit the following line in <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">\/etc\/default\/jenkins<\/code>.<\/p>\n<pre style=\"padding-left: 30px;\"># port for HTTP connector (default 8080; disable with -1)\r\nHTTP_PORT=8081<\/pre>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"MySQL_configuration_on_a_local_machine\"><\/span>MySQL configuration on a local machine<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Enable an inbound connection on the workstation.<\/p>\n<pre style=\"padding-left: 30px;\">\r\nsudo iptables -A INPUT -p tcp -s client_host_ip --dport 3306 -j ACCEPT\r\n<\/pre>\n<p>Create a new account in the MySQL database and grant necessary permissions to a new user to access the project database remotely.<\/p>\n<pre style=\"padding-left: 30px;\">\r\nGRANT ALL PRIVILEGES ON your_database.*\r\n    TO 'user'@'remote_host'\r\n    IDENTIFIED BY 'password';\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Examples\"><\/span>Examples<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Below, you will find a sample of <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">manifest.yml<\/code>.<\/p>\n<pre style=\"padding-left: 30px;\">---\r\n<em>applications:<\/em>\r\n<em>- name: bc<\/em> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#0000ff\"># you can use any name you like<\/font>\r\n  <em>memory: 512M\r\n  instances: 1\r\n  host: bc<\/em>\t\t\t\t\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#0000ff\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# use your own value here<\/font>\r\n  domain: 192.168.1.180.xip.io\t\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#0000ff\"># api.<ip Address>.xip.io accordingly to cf_nise_installer installation steps<\/ip><\/font>\r\n  command: bundle exec rake db:drop db:create db:migrate && bundle exec rails s -p $PORT\r\n  path: .\r\n  env:\r\n    DATABASE_URL: mysql2:\/\/user:password@host_name:port\/db_name\t<font color=\"#0000ff\"># replace with actual value<\/font><\/pre>\n<blockquote><p>Important: It is necessary to provide the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">DATABASE_URL<\/code> variable in the manifest file; otherwise, the deployment will fail. The full list of available environmental variables can be found in <a href=\"https:\/\/docs.cloudfoundry.org\/buildpacks\/ruby\/ruby-tips.html\" target=\"_blank\" rel=\"noopener noreferrer\">official docs<\/a>.<\/p><\/blockquote>\n<p>Jenkins build steps from <em>Execute shell<\/em> are as shown below.<\/p>\n<pre style=\"padding-left: 30px;\">\r\n#!\/bin\/bash -exl\r\ncd $WORKSPACE\r\nsource ~\/.bash_profile\r\nrvm gemset use ruby-1.9.3-p484@cf2\r\ncp ~\/shared\/database.yml config\/database.yml\r\n\r\nbundle install\r\nbundle exec rake db:drop RAILS_ENV=test\r\nbundle exec rake db:create RAILS_ENV=test\r\nbundle exec rake db:schema:load RAILS_ENV=test\r\nbundle exec rspec\r\n\r\n<strong>cf login -a ${target} -u ${login} -p ${password}  -o  ${org} -s ${space}\r\ncp ~\/shared\/manifest.yml .\r\ncf push\r\ncf logout<\/strong>\r\n<\/pre>\n<p>We hope, this tutorial will help you to provide continuous integration on Cloud Foundry using Jenkins. If you have anything to add, just let us know in the comments.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/hidden-tricks-of-jenkins-to-bolster-continuous-integration-on-pivotal-cloud-foundry\/\">Hidden Tricks of Jenkins to Bolster Continuous Integration on Pivotal Cloud Foundry<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/8-pro-tips-for-using-concourse-ci-with-cloud-foundry\/\">8 Pro Tips for Using Concourse CI with Cloud Foundry<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/addressing-complex-software-systems-with-microservices-and-ci-cd\/\">Addressing Complex Software Systems with Microservices and CI\/CD<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"About_the_author\"><\/span>About the author<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><small><strong>Aliaksei Marydashvili<\/strong> is a Cloud Foundry engineer at Altoros. Since 2005, he has acquired broad background in Java and Ruby on Rails. Currently, Aliaksei is improving experience with these technologies on Cloud Foundry, bringing his R&#038;D expertise to integrate solutions around the PaaS and optimize software delivery processes.<\/small><\/p>\n<hr \/>\n<p><center><small>This post was written by <b>Aliaksei Marydashvili<\/b> and edited by <a href=\"https:\/\/www.altoros.com\/blog\/author\/alex\/\">Alex Khizhniak<\/a>.<\/small><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continuous integration (CI) allows for pushing regular enhancements and bug fixes to your application in an easy, fast, and safe way. When using this practice, every time a developer commits a change, the software has to pass a number of tests. This guarantees that every new release is safe and [&#8230;]<\/p>\n","protected":false},"author":5,"featured_media":46579,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,206],"class_list":["post-46566","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-oss-cloud-foundry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros<\/title>\n<meta name=\"description\" content=\"With real-life examples, this tutorial explains how to set up infrastructure, a remote system, an RVM, as well as configure Jenkins and MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros\" \/>\n<meta property=\"og:description\" content=\"Continuous integration (CI) allows for pushing regular enhancements and bug fixes to your application in an easy, fast, and safe way. When using this practice, every time a developer commits a change, the software has to pass a number of tests. This guarantees that every new release is safe and [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-18T16:50:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-09-10T11:49:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"585\" \/>\n\t<meta property=\"og:image:height\" content=\"419\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Alex Khizhniak\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Khizhniak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/\",\"name\":\"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif\",\"datePublished\":\"2014-06-18T16:50:35+00:00\",\"dateModified\":\"2019-09-10T11:49:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/3d914db6ad1b2908c32c0dc5dcabc420\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif\",\"width\":585,\"height\":419},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/3d914db6ad1b2908c32c0dc5dcabc420\",\"name\":\"Alex Khizhniak\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/druzya-edit1-150x150.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/druzya-edit1-150x150.jpg\",\"caption\":\"Alex Khizhniak\"},\"description\":\"Alex Khizhniak is Director of Technical Content Strategy at Altoros and a cofounder of a local Java User Group. Managing distributed teams since 2004, he has gained experience as a journalist, an editor-in-chief, a technical writer, a technology evangelist, a project manager, and a product owner. Alex is obsessed with AI\/ML, data science, data integration, ETL\/DWH, data quality, databases (SQL\/NoSQL), big data, IoT, and BI. The articles and industry reports he created or helped to publish reached out to 3,000,000+ tech-savvy readers. Some of the pieces were covered on TechRepublic, ebizQ, NetworkWorld, CIO.com, etc. Find him on Twitter at @alxkh.\",\"sameAs\":[\"https:\/\/x.com\/https:\/\/twitter.com\/alxkh\"],\"url\":\"https:\/\/www.altoros.com\/blog\/author\/alex\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros","description":"With real-life examples, this tutorial explains how to set up infrastructure, a remote system, an RVM, as well as configure Jenkins and MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros","og_description":"Continuous integration (CI) allows for pushing regular enhancements and bug fixes to your application in an easy, fast, and safe way. When using this practice, every time a developer commits a change, the software has to pass a number of tests. This guarantees that every new release is safe and [...]","og_url":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/","og_site_name":"Altoros","article_published_time":"2014-06-18T16:50:35+00:00","article_modified_time":"2019-09-10T11:49:24+00:00","og_image":[{"width":585,"height":419,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif","type":"image\/gif"}],"author":"Alex Khizhniak","twitter_misc":{"Written by":"Alex Khizhniak","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/","url":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/","name":"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif","datePublished":"2014-06-18T16:50:35+00:00","dateModified":"2019-09-10T11:49:24+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/3d914db6ad1b2908c32c0dc5dcabc420"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2014\/06\/enabling-continuous-integration-pipeline-with-jenkins-on-cloud-foundry.gif","width":585,"height":419},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/how-to-install-jenkins-ci-on-cloud-foundry-for-continuous-delivery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install Jenkins CI on Cloud Foundry for Continuous Delivery"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/3d914db6ad1b2908c32c0dc5dcabc420","name":"Alex Khizhniak","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/druzya-edit1-150x150.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/06\/druzya-edit1-150x150.jpg","caption":"Alex Khizhniak"},"description":"Alex Khizhniak is Director of Technical Content Strategy at Altoros and a cofounder of a local Java User Group. Managing distributed teams since 2004, he has gained experience as a journalist, an editor-in-chief, a technical writer, a technology evangelist, a project manager, and a product owner. Alex is obsessed with AI\/ML, data science, data integration, ETL\/DWH, data quality, databases (SQL\/NoSQL), big data, IoT, and BI. The articles and industry reports he created or helped to publish reached out to 3,000,000+ tech-savvy readers. Some of the pieces were covered on TechRepublic, ebizQ, NetworkWorld, CIO.com, etc. Find him on Twitter at @alxkh.","sameAs":["https:\/\/x.com\/https:\/\/twitter.com\/alxkh"],"url":"https:\/\/www.altoros.com\/blog\/author\/alex\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=46566"}],"version-history":[{"count":13,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46566\/revisions"}],"predecessor-version":[{"id":46583,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46566\/revisions\/46583"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/46579"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=46566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=46566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=46566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}