{"id":2386,"date":"2017-01-06T08:26:14","date_gmt":"2017-01-06T08:26:14","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2386"},"modified":"2023-05-18T05:25:23","modified_gmt":"2023-05-18T12:25:23","slug":"deployment-pipeline-docker-jenkins-java-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/","title":{"rendered":"Deployment Pipeline using Docker, Jenkins, Java and Couchbase"},"content":{"rendered":"<p>This blog explains how to create\u00a0a Deployment Pipeline using Jenkins and Docker for a Java application talking to a database.<\/p>\n<p>Jenkins support the creation of pipelines. They are\u00a0built with simple text scripts that use a Pipeline DSL (domain-specific language) based on the Groovy programming language. The script, typically called <code>Jenkinsfile<\/code>, defines\u00a0multiple<br \/>\nsteps to execute both simple and complex tasks according to the parameters that you establish. Once created, pipelines can build code and orchestrate the work required to drive applications from commit to delivery.<\/p>\n<p>A pipeline consists of <em>steps<\/em>, <em>node<\/em> and <em>stage<\/em>. A pipeline is executed on a node\u00a0&#8211; a computer that is part of Jenkins installation. A pipeline\u00a0often consists of multiple stages. A stage consists of multiple steps.\u00a0Read<br \/>\n<a href=\"https:\/\/jenkins.io\/doc\/pipeline\/\">Getting Started with Pipeline<\/a> for more details.<\/p>\n<p>For our application, here is the basic flow:<\/p>\n<p><a href=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-1024x450.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14287\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-1024x450.png\" alt=\"docker-pipeline-jenkins\" width=\"604\" height=\"265\" \/><\/a><\/p>\n<p>Complete source code for\u00a0the\u00a0application\u00a0used is at\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\">github.com\/arun-gupta\/docker-jenkins-pipeline<\/a>.<\/p>\n<p>The\u00a0application\u00a0is defined in the\u00a0<code>webapp<\/code> directory. It opens a connection to the <a href=\"https:\/\/developer.couchbase.com\/server\">Couchbase<\/a> database\u00a0and\u00a0stores a simple JSON document using <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/java\/start-using-sdk.html\">Couchbase Java SDK<\/a>.<br \/>\nThe application also has a test that verifies that the database\u00a0indeed contains the document that was persisted.<\/p>\n<p>Many thanks to <a href=\"https:\/\/twitter.com\/alexsotob\">@alexsotob<\/a> for helping me with\u00a0Jenkins configuration.<\/p>\n<p>Let&#8217;s get started!<\/p>\n<h2>Download and Install\u00a0Jenkins<\/h2>\n<ul>\n<li>Download\u00a0Jenkins from <a href=\"https:\/\/jenkins.io\">jenkins.io<\/a>. This\u00a0was tested with <a href=\"https:\/\/mirrors.jenkins-ci.org\/war\/2.21\/jenkins.war\">Jenkins 2.21<\/a>.<\/li>\n<li>Start Jenkins:\n<pre class=\"lang:default decode:true\">JENKINS_HOME=~\/.jenkins java -jar ~\/Downloads\/jenkins-2.21.war --httpPort=9090<\/pre>\n<p>This command\u00a0starts\u00a0Jenkins by specifying the home directory where all the configuration information is stored. It also defines the port on which Jenkins<br \/>\nis listening, <code>9090<\/code> in this case.<\/li>\n<li>First start of Jenkins shows the\u00a0following message in the console:\n<pre class=\"lang:default decode:true\">*************************************************************\r\n*************************************************************\r\n*************************************************************\r\n\r\nJenkins initial setup is required. An admin user has been created and a password generated.\r\nPlease use the following password to proceed to installation:\r\n\r\n3521fbc3d40448efa8942f8e464b2dd9\r\n\r\nThis may also be found at: \/Users\/arungupta\/.jenkins\/secrets\/initialAdminPassword\r\n\r\n*************************************************************\r\n*************************************************************\r\n*************************************************************<\/pre>\n<p>Copy the\u00a0password shown here. This will be used to unlock Jenkins.<\/li>\n<li>Access the Jenkins console at <a href=\"https:\/\/localhost:9090\">localhost:9090<\/a> and paste the password:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14279\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-unlock-1024x525.png\" alt=\"docker-pipeline-jenkins-unlock\" width=\"604\" height=\"310\" \/><br \/>\nClick on\u00a0<code>Next<\/code>.<\/li>\n<li>Create the first admin user as shown:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14271\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-create-admin-user-1024x837.png\" alt=\"docker-pipeline-jenkins-create-admin-user\" width=\"604\" height=\"494\" \/><br \/>\nClick on <code>Save and Finish<\/code>.<\/li>\n<li>Click on <code>Install suggested plugins<\/code>:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14278\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-install-suggested-plugins-1024x668.png\" alt=\"docker-pipeline-jenkins-install-suggested-plugins\" width=\"604\" height=\"394\" \/><br \/>\nA bunch of default plugins are installed:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14273\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-installing-suggested-plugins-1024x824.png\" alt=\"docker-pipeline-jenkins-installing-suggested-plugins\" width=\"604\" height=\"486\" \/><br \/>\nFound it surprising that Ant and Subversion are the default plugins.<\/li>\n<li>Login screen is prompted.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14274\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-login-1024x402.png\" alt=\"docker-pipeline-jenkins-login\" width=\"604\" height=\"237\" \/><br \/>\nEnter the username and password specified earlier.<\/li>\n<li>Finally, Jenkins is ready to use:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14277\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-start-using-1024x835.png\" alt=\"docker-pipeline-jenkins-start-using\" width=\"604\" height=\"493\" \/><\/li>\n<\/ul>\n<p>That&#8217;s quite a bit of steps to\u00a0get started with basic Jenkins. Do I really have to jump through all these hoops to get started with Jenkins? Is there an easier, simpler, dumber, lazier way to start Jenkins?\u00a0Follow\u00a0Convention-over-Configuration<br \/>\nand give me\u00a0one-click pre-configured installation.<\/p>\n<h2>Install Jenkins\u00a0Plugins<\/h2>\n<p>Install the required\u00a0plugins in Jenkins.<\/p>\n<ol>\n<li>If your Java project is built using Maven, then you need to configure Maven in Jenkins. Click on <code>Manage Jenkins<\/code>, <code>Global Tool Configuration<\/code>, <code>Maven installations<\/code>, and specify the location of Maven.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14269\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-configure-maven-1024x328.png\" alt=\"docker-pipeline-jenkins-configure-maven\" width=\"604\" height=\"193\" \/><br \/>\nName the tool as <code>Maven3<\/code> as that is the name used\u00a0in the configuration later.Again a bit lame, why can&#8217;t Jenkins pick up the default location of Maven instead of expecting the user to specify a location.<\/li>\n<li>Click on <code>Manage Jenkins<\/code>, <code>Manage Plugins<\/code>, <code>Available<\/code> tab, search for <code>docker pipe<\/code>. Select <code>CloudBees Docker Pipeline<\/code>, click on <code>Install without restart<\/code>. <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14275\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-pipeline-plugin-1024x277.png\" alt=\"docker-pipeline-jenkins-pipeline-plugin\" width=\"604\" height=\"163\" \/><br \/>\nClick on <code>Install without restart<\/code>.<a href=\"https:\/\/go.cloudbees.com\/docs\/cloudbees-documentation\/cje-user-guide\/chapter-docker-workflow.html\">Docker Pipeline Plugin<\/a>\u00a0plugin understands the Jenkinsfile and executes<br \/>\nthe commands listed there.<\/li>\n<li>Next screen shows the list of plugins that are installed:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14276\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-pipeline-plugin-restart-jenkins-1024x541.png\" alt=\"docker-pipeline-jenkins-pipeline-plugin-restart-jenkins\" width=\"604\" height=\"319\" \/><br \/>\nThe last line shows that CloudBees Docker Pipeline plugin is installed successfully. Select <code>Restart Jenkins<\/code> checkbox. This will install restart Jenkins as well.<\/li>\n<\/ol>\n<h2>Create Jenkins Job<\/h2>\n<p>Let&#8217;s create\u00a0a job in Jenkins that will run the pipeline.<\/p>\n<ol>\n<li>After Jenkins restarts, it shows the login screen. Enter the username and password created earlier. This brings you back to\u00a0<code>Installing Plugins\/Upgrades<\/code> page. Click on the\u00a0Jenkins icon in the top left corner to see the main dashboard:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14288\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-dashboard-1024x693.png\" alt=\"docker-pipeline-jenkins-dashboard\" width=\"604\" height=\"409\" \/><\/li>\n<li>Click on <code>create new jobs<\/code>, give the\u00a0name as <code>docker-jenkins-pipeline<\/code> and choose the\u00a0type as Pipeline:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14272\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-create-project-1024x867.png\" alt=\"docker-pipeline-jenkins-create-project\" width=\"604\" height=\"511\" \/><br \/>\nClick on OK.<\/li>\n<li>Configure Pipeline as shown:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14270\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-configure-pipeline-1024x807.png\" alt=\"docker-pipeline-jenkins-configure-pipeline\" width=\"604\" height=\"476\" \/><br \/>\nLocal git repo is used\u00a0in this case. You can certainly choose a repo hosted on github. Further, this\u00a0repo can be configured with a git hook or poll at a constant interval to trigger the pipeline. Click on<br \/>\n<code>Save<\/code> to save the configuration.<\/li>\n<\/ol>\n<h2>Run Jenkins Build<\/h2>\n<p>Before you start the job, Couchbase database need to be explicitly started as:<\/p>\n<pre class=\"lang:default decode:true\">docker run -d --name db -p 8091-8093:8091-8093 -p 11210:11210 arungupta\/oreilly-couchbase:latest<\/pre>\n<p>This will be resolved after <a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/9\">#9<\/a> is fixed.\u00a0 Make sure you can access Couchbase at https:\/\/localhost:8091, use <code>Administrator<\/code> as the login and <code>password<\/code> as the password. Click on <code>Data Buckets<\/code>\u00a0tab and see the <code>books<\/code> bucket created.<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-couchbase-books-1024x307.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14290\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-couchbase-books-1024x307.png\" alt=\"docker-pipeline-couchbase-books\" width=\"604\" height=\"181\" \/><\/a><br \/>\nClick on <code>Build Now<\/code> and you should see an output similar to:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-build-run-1024x498.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14289\" src=\"\/wp-content\/original-assets\/september-2016\/deployment-pipeline-using-docker-jenkins-java-and-couchbase\/docker-pipeline-jenkins-build-run-1024x498.png\" alt=\"docker-pipeline-jenkins-build-run\" width=\"604\" height=\"294\" \/><\/a><br \/>\nAll green is good!<\/p>\n<p>Let&#8217;s try to understand what happened behind the scene. <a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/blob\/master\/Jenkinsfile\">Jenkinsfile<\/a>\u00a0describes how the pipeline is built. At the top level, it has four stages &#8211; Package, Create<br \/>\nDocker Image, Run Application and Run Tests. Each\u00a0stage is shown as a\u00a0box\u00a0in Jenkins dashboard. Total time taken for each stage is shown in the box.<\/p>\n<p>Let&#8217;s understand what happens in each stage.<\/p>\n<ul>\n<li><strong>Package<\/strong> &#8211; Application source code lives in the <code>webapp<\/code> directory. Maven command <code>mvn clean package -DskipTests<\/code> is used to create a JAR file of the application. Note that\u00a0the\u00a0maven project also includes<br \/>\nthe tests and are explicitly skipped using <code>-DskipTests<\/code>. Typically, tests would be in a <a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/7\">separate downstream project<\/a>.Maven project\u00a0creates a far JAR file<br \/>\nof the application and includes all\u00a0the dependencies.<\/li>\n<li><strong>Create Docker Image<\/strong> &#8211;\u00a0Docker image of the application is built using the <a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/blob\/master\/webapp\/Dockerfile\">Dockerfile<\/a> in\u00a0the <code>webapp<\/code> directory.<br \/>\nThe image simply includes the fat JAR and runs it using <code>java -jar<\/code>.Each image is tagged with the build number using <code>${env.BUILD_NUMBER}<\/code>.<\/li>\n<li><strong>Run Application<\/strong> &#8211; Running the application involves running the application Docker container.IP address of the database container is identified using the <code>docker inspect<\/code> command.The database container and the application<br \/>\ncontainer are both running in the default <code>bridge<\/code> network. This allows the two\u00a0containers to communicate with each other. Another enhancement would be to run the pipeline in a swarm mode cluster. This would require to\u00a0create<br \/>\nand use an <code>overlay<\/code> network.<\/li>\n<li><strong>Run Tests<\/strong> &#8211;\u00a0Tests are run against the container using the <code>mvn test<\/code> command. If the tests pass the image is pushed to Docker Hub. The test results are captured either way.This\u00a0stage also shows the usage of <code>try<\/code>\/<code>catch<\/code>\/<code>finally<\/code> block in Jenkinsfile. If the tests pass then the image is pushed to Docker Hub. In this case, it is available at\u00a0<a href=\"https:\/\/hub.docker.com\/r\/arungupta\/docker-jenkins-pipeline\/tags\/\">hub.docker.com\/r\/arungupta\/docker-jenkins-pipeline\/tags\/<\/a>.<\/li>\n<\/ul>\n<p>Some TODOs &#8230;<\/p>\n<ul>\n<li>Move the tests to a downstream project (<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/7\">#7<\/a>)<\/li>\n<li>Use Git hook or poll to trigger pipeline (<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/8\">#8<\/a>)<\/li>\n<li>Automate database startup\/shutdown (<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/9\">#9<\/a>)<\/li>\n<li>Run pipeline in a cluster of Docker Engines with Swarm mode (<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/10\">#10<\/a>)<\/li>\n<li>Show alternate configuration to push image to bintray (<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\/11\">#11<\/a>)<\/li>\n<\/ul>\n<p>Another pain point is that\u00a0global variables syntax does not seem to be documented anywhere. It is only available at\u00a0:\/job\/docker-jenkins-pipeline\/pipeline-syntax\/globals. This is again slightly\u00a0lame!<br \/>\n&#8221;<br \/>\n<a href=\"https:\/\/twitter.com\/agentdero\/status\/773987834982076416\">not impossible, just not implemented yet<\/a>&#8221;\u00a0#sadpanda<\/p>\n<p>Some further references to read:<\/p>\n<ul>\n<li><a href=\"https:\/\/jenkins.io\/doc\/pipeline\/\">Getting Started with the Jenkinsfile<\/a><\/li>\n<li><a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/CloudBees+Docker+Pipeline+Plugin\">CloudBees Docker Pipeline Plugin<\/a><\/li>\n<li><a href=\"https:\/\/go.cloudbees.com\/docs\/cloudbees-documentation\/cje-user-guide\/chapter-docker-workflow.html\">CloudBees Docker Pipeline Plugin\u00a0User Guide<\/a><\/li>\n<li><a href=\"https:\/\/jenkins.io\/doc\/pipeline\/steps\/\">Jenkinsfile DSL Reference<\/a><\/li>\n<li><a href=\"https:\/\/2016.javazone.no\/program\/jenkins-pipeline-jenkins-2-0-and-beyond\">Jenkins Pipeline Talk from JavaZone 2016<\/a><\/li>\n<\/ul>\n<p>More information about Couchbase:<\/p>\n<ul>\n<li><a href=\"https:\/\/developer.couchbase.com\/server\">Couchbase Developer Portal<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase Forums<\/a><\/li>\n<li><a href=\"https:\/\/twitter.com\/couchbasedev\">@couchbasedev<\/a> or <a href=\"https:\/\/twitter.com\/couchbase\">@couchbase<\/a><\/li>\n<\/ul>\n<p>Feel free to file bugs at\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/docker-jenkins-pipeline\/issues\">github.com\/arun-gupta\/docker-jenkins-pipeline\/issues<\/a> or send PR.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog explains how to create\u00a0a Deployment Pipeline using Jenkins and Docker for a Java application talking to a database. Jenkins support the creation of pipelines. They are\u00a0built with simple text scripts that use a Pipeline DSL (domain-specific language) based [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816],"tags":[],"ppma_author":[8933],"class_list":["post-2386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Deploy Pipeline using Docker, Jenkins, Java &amp; Couchbase<\/title>\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.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deployment Pipeline using Docker, Jenkins, Java and Couchbase\" \/>\n<meta property=\"og:description\" content=\"This blog explains how to create\u00a0a Deployment Pipeline using Jenkins and Docker for a Java application talking to a database. Jenkins support the creation of pipelines. They are\u00a0built with simple text scripts that use a Pipeline DSL (domain-specific language) based [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-06T08:26:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-18T12:25:23+00:00\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Deployment Pipeline using Docker, Jenkins, Java and Couchbase\",\"datePublished\":\"2017-01-06T08:26:14+00:00\",\"dateModified\":\"2023-05-18T12:25:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\"},\"wordCount\":1115,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\",\"name\":\"Deploy Pipeline using Docker, Jenkins, Java & Couchbase\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-01-06T08:26:14+00:00\",\"dateModified\":\"2023-05-18T12:25:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deployment Pipeline using Docker, Jenkins, Java and Couchbase\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Deploy Pipeline using Docker, Jenkins, Java & Couchbase","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.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/","og_locale":"en_US","og_type":"article","og_title":"Deployment Pipeline using Docker, Jenkins, Java and Couchbase","og_description":"This blog explains how to create\u00a0a Deployment Pipeline using Jenkins and Docker for a Java application talking to a database. Jenkins support the creation of pipelines. They are\u00a0built with simple text scripts that use a Pipeline DSL (domain-specific language) based [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-01-06T08:26:14+00:00","article_modified_time":"2023-05-18T12:25:23+00:00","author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Deployment Pipeline using Docker, Jenkins, Java and Couchbase","datePublished":"2017-01-06T08:26:14+00:00","dateModified":"2023-05-18T12:25:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/"},"wordCount":1115,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/","name":"Deploy Pipeline using Docker, Jenkins, Java & Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-01-06T08:26:14+00:00","dateModified":"2023-05-18T12:25:23+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/deployment-pipeline-docker-jenkins-java-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Deployment Pipeline using Docker, Jenkins, Java and Couchbase"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, VP, Developer Advocacy, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.\r\n\r\nGupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2386"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2386\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2386"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}