text: (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{399:function(e,t,a){e.exports=a.p+"assets/img/01_builds.9fd36c48.png"},400:function(e,t,a){e.exports=a.p+"assets/img/01_build_logs.18c1a8c6.png"},401:function(e,t,a){e.exports=a.p+"assets/img/01_build_logs_02.182d3d4e.png"},402:function(e,t,a){e.exports=a.p+"assets/img/01_build_logs_03.1a05c23a.png"},480:function(e,t,a){"use strict";a.r(t);var s=a(32),o=Object(s.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"builds"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#builds"}},[e._v("#")]),e._v(" Builds")]),e._v(" "),s("p",[e._v("In this lab, you will create a simple Docker based build for the Rocket Chat application.")]),e._v(" "),s("h2",{attrs:{id:"the-tools-project"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#the-tools-project"}},[e._v("#")]),e._v(" The Tools Project")]),e._v(" "),s("p",[e._v("The tools project is what will hold various support tools for the application. In this case, all builds will run in this project.")]),e._v(" "),s("h2",{attrs:{id:"creating-a-docker-based-build"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#creating-a-docker-based-build"}},[e._v("#")]),e._v(" Creating a Docker-Based Build")]),e._v(" "),s("p",[e._v("The Rocket.Chat application build will be based off a minimal Dockerfile in a "),s("a",{attrs:{href:"https://github.com/BCDevOps/devops-platform-workshops-labs/tree/master/apps/rocketchat",target:"_blank",rel:"noopener noreferrer"}},[e._v("public repository"),s("OutboundLink")],1),e._v(".\nLeveraging the commandline, you can use the "),s("code",[e._v("oc new-build")]),e._v(" command to create all of the necessary\nOpenShift build components.")]),e._v(" "),s("p",[e._v("Ensure that all team members have edit rights into the project. Once complete,\neach member can create their own Rocket.Chat docker build.")]),e._v(" "),s("ul",[s("li",[e._v("To start, switch to the "),s("strong",[e._v("Tools Project")])])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("oc project [-tools]\n")])])]),s("ul",[s("li",[e._v("With the "),s("code",[e._v("oc")]),e._v(" cli, create the build")])]),e._v(" "),s("div",{staticClass:"language-oc:cli extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("oc -n [-tools] new-build https://github.com/BCDevOps/devops-platform-workshops-labs/ --context-dir=apps/rocketchat --name=rocketchat-[username]\n")])])]),s("ul",[s("li",[e._v("The output of the previous command should be similar to the following:")])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('\n--\x3e Found image 8431f8b (21 hours old) in image stream "ocp101a-tools/rocketchat" under tag "latest" for "rocketchat"\n\n    Node.js 8 \n    --------- \n    Node.js 8 available as container is a base platform for building and running various Node.js 8 applications and frameworks. Node.js is a platform built on Chrome\'s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.\n\n    Tags: builder, nodejs, nodejs8\n\n    * A Docker build using source code from https://github.com/BCDevOps/devops-platform-workshops-labs/ will be created\n      * The resulting image will be pushed to image stream "rocketchat-[username]:latest"\n      * Use \'start-build\' to trigger a new build\n\n--\x3e Creating resources with label build=rocketchat-[username] ...\n    imagestream "rocketchat-[username]" created\n    buildconfig "rocketchat-[username]" created\n--\x3e Success\n    Build configuration "rocketchat-[username]" created and build triggered.\n    Run \'oc logs -f bc/rocketchat-[username]\' to stream the build progress.\n')])])]),s("ul",[s("li",[e._v("The build will take between a couple of minutes to about 15 minutes")])]),e._v(" "),s("div",{staticClass:"language-oc:cli extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# Watch and wait for build\noc -n [-tools] logs -f bc/rocketchat-[username]\n")])])]),s("ul",[s("li",[e._v("You can now explore the Web Console to watch the build status from "),s("code",[e._v("Builds")]),e._v(" "),s("em",[e._v("note")]),e._v(" you will see multiple builds from each team member")])]),e._v(" "),s("p",[s("img",{attrs:{src:a(399),alt:""}})]),e._v(" "),s("ul",[s("li",[e._v("Or this can be done on the CLI")])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("oc -n [-tools] get bc\noc -n [-tools] status\n")])])]),s("ul",[s("li",[e._v("The build status can be monitored from the Web Console by selecting  the "),s("code",[e._v("Logs")]),e._v(" link")])]),e._v(" "),s("p",[s("img",{attrs:{src:a(400),alt:""}}),e._v(" "),s("img",{attrs:{src:a(401),alt:""}}),e._v(" "),s("img",{attrs:{src:a(402),alt:""}})])])}),[],!1,null,null,null);t.default=o.exports}}]);