CI/CD Full Course | CI/CD Tutorial | Continuous Integration And Continuous Delivery | Simplilearn

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone i welcome you all to this ci cd fill course by simply learn in this complete course we will learn everything we need to know about the cicd pipeline in devops we have mathifs and anuj to guide us through this journey we shall begin with understanding the basics of devops and have a look at the different aspects of devops after knowing the basics of devops we shall start with the cicd pipeline in the process we shall understand what continuous integration and continuous deployment is all about while learning about the pipeline we shall learn how is it implemented with the help of a hands-on demo moving forward we shall learn in detail about jenkins and how to implement the ci cd pipeline with jenkins after we have ample knowledge regarding the cicd pipeline we shall dive a little more and check the difference between continuous delivery and continuous deployment and finally we shall understand why ci cd is considered the best devops practice but before we begin make sure that you have subscribed to our youtube channel and don't forget to hit that bell icon so that you can never miss an update from simply learn now without further ado let's begin with our introduction we're going to go through a number of key elements today the first two will be reviewing models that you're already probably using for delivering solutions into your company and the most popular one is waterfall followed by agile then we'll look at devops and how devops differs from the two models and how it also borrows and leverages the best of those models we'll go through each of the phases that are used in typical devops delivery and then the tools used within those phases to really improve the efficiencies within devops finally we'll summarize the advantages that devops brings to you and your teams so let's go through waterfall so waterfall is a traditional delivery model that's been used for many decades for delivering solutions not just it solutions and digital solutions but even way before that it has its history that goes back to world war ii so waterfall is a model that is used to capture requirements and then cascade each key deliverable through a series of different stage gates that is used for building out the solution so let's take you through each of those stage gates the first that you may have done is requirements analysis and this is where you sit down with the actual client and you understand specifically what they actually do and what they're looking for in the software that you're going to build and then from that requirements analysis you'll build out a project planning so you have an understanding of what the level of work is needed to be able to be successful in delivering the solution after that you've got your plan then you start doing the development and that means that the programmers start coding out their solution they build out their applications to build out the websites and this can take weeks or even months to actually do all the work when you've done your coding and development then you send it to another group that does testing and they'll do full regression testing of your application against the systems and databases that integrate with your application you'll test it against the actual code you'll do manual testing you do ui testing and then after you've delivered the solution you go into maintenance mode which is just kind of making sure that the application keeps working there's any security risks that you address those security risks the problem you have though is that there are some challenges however that you have with the waterfall model the cascading deliveries and those complete and separated stage gates means that it's very difficult for any new requirements from the client to be integrated into the project so if a client comes back and if the project has been running for six months and they've gone hey we need to change something that means that we have to almost restart the whole project it's very expensive and it's very time consuming also if you spend weeks and months away from your clients and you deliver a solution that they are only just going to see after you spend a lot of time working on it they could be pointing out things that are in the actual final application that they don't want or are not implemented correctly or lead to just general unhappiness the challenge you then have is if you want to add back in the client's feedback to restart the whole waterfall cycle again so the client will come back to you with a list of changes and then you go back and you have to start your programming and you have to then start your testing process again and just you're really adding in lots of additional time into the project so using the watford model companies have soon come to realize that you know the clients just aren't able to get their feedback in quickly effectively it's very expensive to make changes once the teams have started working and the requirement in today's digital world is that solutions simply must be delivered faster and this has led for a specific change in agile and we start implementing the agile model so the agile model allows programmers to create prototypes and get those prototypes to the client with the requirements faster and the client is able to then send the requirements back to the programmer with feedback this allows us to create what we call a feedback loop we're able to get information to the client and the client can get back to the development team much faster typically when we're actually going through this process we're looking at the engagement cycle being about two weeks and so it's much faster than the traditional waterfall approach and so we can look at each feedback loop as comprising of four key elements we have the planning where we actually sit down with the client and understand what they're looking for we then have coding and testing that is building out the code and the solution that is needed for the client and then we review with the client the changes that have happened but we do all this in a much tighter cycle that we call a sprint and that typically a sprint will last for about two weeks some companies run sprints every week some run every four weeks it's up to you as a team to decide how long you want to actually run a sprint but typically it's two weeks and so every two weeks the client is able to provide feedback into that loop and so you were able to move quickly through iterations and so if we get to the end of sprint two and the client says hey you know what we need to make a change you can make those changes quickly and effectively for sprint three what we have here is a breakdown of the ceremonies and the approach that you bring to agile so typically what will happen is that a product leader will build out a backlog of products and what we call a product backlog and this will be just a whole bunch of different features and they may be small features or bug fixes all the way up to large features that may actually span over multiple sprints but when you go through the sprint planning you want to actually break out the work that you're doing so the team has a mixture of small medium and large solutions that they can actually implement successfully into their sprint plan and then once you actually start running your sprint again it's a two week activity you meet every single day to with the actual sprint team to ensure that everybody is staying on track and if there's any blockers that those blockers are being addressed effectively and immediately the goal at the end of the two weeks is to have a deliverable product that you can put in front of the customer and the customer can then do a review the key advantages you have of running a sprint with agile is that the client requirements are better understood because the client is really integrated into the scrum team they're there all the time and the product is delivered much faster than with a traditional waterfall model you're delivering features at the end of each sprint versus waiting weeks months or in some cases years for a waterfall project to be completed however there are also some distinct disadvantages the product itself really doesn't get tested in a production environment it's only been tested on the developer computers and it's really hard when you're actually running agile for the sprint team to actually build out a solution easily and effectively on their computers to mimic the production environment and the developers and the operations team are running in separate silos so you have your development team running their sprint and actually working to build out the features but then when they're done at the end of their sprint and they want to do a release they kind of fling it over the wall at the operations team and then it's the operations team job to actually install the software and make sure that the environment is running in a stable fashion that is really difficult to do when you have the two teams really not working together so here we have is a breakdown of that process with the developers submitting their work to the operations team for deployment and then the operations team may submit their work to the production servers but what if there is an error what if there was a setup configuration error with the developers test environment that doesn't match the production environment there may be a dependency that isn't there there may be a link to an api that doesn't exist in production and so you have these challenges that the operations team are constantly faced with and their challenge is that they don't know how the code works so this is where devops really comes in and let's dig into how devops which is developers and operators working together is the key for successful continuous delivery so devops is as an evolution of the agile model the agile model really is great for gathering requirements and for developing and testing out your solutions and what we want to be able to do is kind of address that challenge and that gap between the ops team and the dev team and so with devops what we're doing is bringing together the operations team and the development team into a single team and they are able to then work more seamlessly together because they are integrated to be able to build out solutions that are being tested in a production-like environment so that when we actually deploy we know that the code itself will work the operations team is then able to focus on what they're really good at which is analyzing the production environment and being able to provide feedback to the developers on what is being successful so we're able to make adjustments in our code that it's based on data so let's step through the different phases of a devops team so typically you'll see that the devops team will actually have eight phases now this is somewhat similar to agile and what i'd like to point out at time is that again agile and devops are very closely related that agile and devops are closely related delivery models that you can use with devops it's really just extending that model with the key phases that we have here so let's step through each of these key phases so the first phase is planning and this is where we actually sit down with a business team and we go through and understand what their goals are the second stage is as you can imagine and this is where it's all very similar to agile is that the coders actually start coding but they typically they'll start using tools such as git which is a distributed version control software it makes it easier for developers to all be working on the same code base rather than bits of the code that is rather than them working on bits of the code that they are responsible for so the goal with using tools such as git is that each developer always has the current and latest version of the code you then use tools such as maven and gradle as a way to consistently build out your environment and then we also use tools to actually automate our testing now what's interesting is when we use tools like selenium and junit is that we're moving into a world where our testing is scripted the same as our build environment and the same as using our get environment we can start scripting out these environments and so we actually have scripted production environments that we're moving towards jenkins is the integration phase that we use for our tools and another pointer here is that the tools that we're listing here these are all open source tools these are tools that any team can start using we want to have tools that control and manage the deployment of code into the production environments and then finally tools such as ansible and chef will actually operate and manage those production environments so that when code comes to them that that code is compliant with the production environment so that when the code is then deployed to the many different production servers that the expected results of those servers which is you want them to continue running is received and then finally you monitor the entire environment so you can actually zero in on spikes and issues that are relevant to either the code or changing consumer habits on the site so let's step through some of those tools that we have in the devops environment so here we have is a breakdown of the devops tools that we have and again one of the things i want to point out is that these tools are open source tools there are also many other tools this is just really a selection of some of the more popular tools that are being used but it's quite likely that you're already using some of these tools today you may already be using jenkins you may already be using git but some of the other tools really help you create a fully scriptable environment so that you can actually start scripting out your entire devops toolset this really helps when it comes to speeding up your delivery because the more you can actually script out of the work that you're doing the more effective you can be at running automation against those scripts and the more effective you can be at having a consistent experience so let's step through this devops process so we go through and we have a continuous delivery which is our plan code build and test environment so what happens if you want to make a release well the first thing you want to do is send out your files to the build environment and you want to be able to test the code that you've been created because we're scripting everything in our code from the actual unit testing being done to the all the way through to the production environment because we're testing all of that we can very quickly identify whether or not there are any defects within the code if there are defects we can send that code right back to the developer with a message saying what the defect is and the developer can then fix that with information that is real on the either the code or the production environment if however your code passes the scripting test it can then be deployed and once it's out to deployment you can then start monitoring that environment what this provides you is the opportunity to speed up your delivery so you go from the waterfall model which is weeks months or even years between releases to agile which is two weeks or four weeks depending on your sprint cadence to where you are today with devops where you can actually be doing multiple releases every single day so there are some significant advantages and there are companies out there that are really zeroing in on those advantages if we take any one of these companies such as google google any given day will actually process 50 to 100 new releases on their website through their devops teams in fact they have some great videos on youtube that you can find out on how their devops teams work netflix is also a similar environment now what's interesting with netflix is that netflix have really fully embraced devops within their development team and so they have a devops team and netflix is a completely digital company so they have software on phones on smart tvs on computers and on websites interestingly though the devops team for netflix is only 70 people and when you consider that a third of all internet traffic on any given day is from netflix it's really a reflection on how effective devops can be when you can actually manage that entire business with just 70 people so there are some key advantages that devops has it's the actual time to create and deliver software is dramatically reduced particularly compared to waterfall complexity and maintenance is also reduced because you're automating and scripting out your entire environment you're improving the communication between all your teams so teams don't feel like they're in separate silos but that are actually working cohesively together and that there is continuous integration and continuous delivery so that your consumer your customer is constantly being delighted learning objectives by the end of this lesson you will be able to describe the importance of continuous integration and continuous deployment list the features of jenkins and demonstrate their uses list the features of team city and demonstrate their uses and select a suitable tool for your organization the overview and importance of continuous integration and continuous deployment overview of continuous integration continuous integration is a development practice of combining code from a number of different developers into a common base intended for deployment each integration event is verified by automated build and automated tests there are many aspects to a continuous integration also known as ci process continuous integration is a development practice of combining code from a number of different developers into a common code base intended for deployment each integration event is verified by automated build and automated tests there are many aspects to a continuous integration also known as ci process these are develop and compile code perform unit tests integrate code with various types of databases perform pre-production deployment activities for example moving code to various types of computing environments such as testing and staging also part of a continuous integration process is to perform functional testing and apply labels against release points in the code repository additional activities in ci are to generate reports and analyze the code continuous integration is about combining code from each developer into a common deployment path automatically with a high degree of accuracy continuous integration is more than a developer just creating some code and committing it to a feature branch he or she is working on for automation to pick up and deploy instead the developer needs to make sure that he or she writes unit tests that exercise each line of code written the purpose of unit testing is to prove that the code that's written works the expectation a standard feature of most shops that practice continuous integration is to have the process run all the unit tests in the developer's work branch before merging the code into a common code base if the unit tests don't pass in the automated process the developer's code is not merged into the common branch then the developer is typically notified either by email or by another communication channel that there's a problem that needs to be corrected overview of continuous deployment deployment is an extension of continuous integration its purpose is to reduce the time between a development team writing code and then using it in production the benefits of continuous deployment are not only that it provides faster feedback from end users as each new feature is released to production but it also realizes a faster return on investment for each feature as it gets developed for the most part continuous deployment is a highly automated process that reduces the need for human interaction in the deployment process scripts take over most of the work that used to be done by humans previously involved in the physical deployment of code not only does automation copy code from one computing environment to another the scripts will actually create the computing environments that need to be in place before you can move the code along automation reduces the time it takes to get code from developer to end user and increases the accuracy of the code that's being produced continuous deployment makes sure that the right code is in the right place at the right time popular tools in continuous integration and continuous deployment the more common ci cd tools used in its practicing devops are jenkins travis ci bamboo team city and get lab continuous integration with jenkins jenkins is one of the more popular tools in the devops landscape it's a powerful framework that supports a broad plug-in ecosystem instead of having to write code on a line-by-line basis to extend the power of jenkins developers write custom plug-ins to add new functionality these plugins are highly reusable so much so that a whole marketplace has evolved around the product there are now over a thousand plugins available and most of these are free also jenkins integrates with over a hundred other devops tools such as github and testing tools from a variety of vendors jenkins allows devops personnel to reliably orchestrate the release tool chain and it's designed to be an end-to-end solution in order to get full benefit from using jenkins aspiring devops personnel need to understand the standard phases in the cicd pipeline these phases are code and commit build and configure scan and test release and deploy you're going to incorporate a variety of tools with jenkins during each phase of the process during code and commit developers use an integrated development environment also known as an ide to create code the popular ones are visual studio visual studio code and eclipse and then they'll check the code into a version control system such as get github perforce or mercurial some code might require binary dependencies that are stored in an artifact repository such as artifactory after code is created and committed it needs to be built if the code requires compilation into a binary file such as a dll exe or jar file jenkins will use a build system such as ms build a c compiler maven for java or and for more general purposes if the code needs to be containerized you'll use docker some itshops will automatically create computing environments during build and configure in anticipation of impending code deployments tools such as puppet chef and ansible can provision virtual machines automatically according to predefined configurations in during the scan and testing phase you'll integrate jenkins with testing tools such as junit j meter cucumber or ms test front end testing can be conducted using selenium appium sawslab or hewlett-packer products the purpose of scan and test is to make sure the code meets quality standards and is safe to move forward in the cicd process the release phase is the last stage before code is released to users you might integrate jenkins with tools such as you deploy serena midvision or release finally for deploy you'll go on premises to a cloud service or a hybrid combination of both a private on-premises cloud and a public cloud for public cloud deployments you'll target amazon web services google cloud azure or ibm cloud also we're seeing cloud orchestration technologies such as kubernetes take an increased presence as a release platform for a private cloud there's openstack if you're working directly with virtual machines you'll integrate jenkins with vmware products or a docker at a high level in terms of application runtimes you'll need something like the jboss java virtual machine or the websphere application server jenkins provides operational consistency in the various stages of release regardless of the particular products you plan to use thus you'll do well to keep these phases of deployment in mind as you continue on your journey to devops mastery continuous deployment with jenkins as you can see in the slide continuous deployment which we abbreviate as cd consists of five operational stages the first stage is coding which is typically done on the developer's local workstation the next stage is storage during the storage phase a developer commits his or her code to a source control management system such as get moving the code into a separate test computing environment ensuring that the code is implemented in the best way possible in addition to ensuring that the code works according to expectation so that it can be released to production is done in the quality assurance and testing stages production is the final stage in the release process production is where the code is made available to end users the value that jenkins brings to the software development life cycle is that it can be configured to automate every stage of the entire process this is very important because it not only speeds up the software development process overall but also increases the accuracy and reliability of the code under development companies such as linkedin google and facebook have made continuous deployment a fundamental part of the way they make software it's only by using an automation tool such as jenkins that effective continuous deployment is possible doing deployment manually is time consuming and costly those who adhere to the principles of devops understand that continuous deployment is an essential part of the practice of software development in the modern enterprise and automation is key to the practice continuous integration with teamcity teamcity is a free continuous integration tool from jetbrains the company is best known for its integrated development environments providing software the abbreviation for integrated development environment is ide team city is a complete continuous deployment continuous integration system designed to automatically manage all aspects of the software development lifecycle teamcity is designed to integrate with all the popular products used in modern software development it integrates well with the standard web browsers as we've learned previously communication among and between teams is important thus team city can be configured to send out notifications using email rss chat tools and social media platforms such as slack it supports version control by integrating with source control management systems such as get subversion perforce as well as many others teamcity supports all the build tools and development frameworks commonly found in the enterprise such as ant maven ms build and grunt also teamcity can be integrated with popular ides such as eclipse the various jetbrain tools such as intellij webstorm and pycharm teamcity also integrates easily with the industry standard for developing microsoft technologies visual studio and visual studio code continuous deployment with teamcity a good way to understand the workflow that teamcity is designed to manage by way of automation is to conceptualize the software development process as having three areas of activity artifact deployment and operations let's take a look at each area in detail artifact activity is about managing the various code components that make up a software system some shops use the term deployment unit to describe the distinct component of code that needs to be released into production other shops use the term deployment artifact some of these components might be a binary file such as java or a jar file or in dot-net shops the artifacts can be an exe or dll file linux doesn't have the concept of file extension based executables thus any file can be an executable you just need to have the right permission set the important thing to understand about the artifact area is that it's about creating and managing deployment units that will be released to production deployment once an artifact or collection of artifacts are ready for release they need to go through a company's deployment process there are a number of tools and processes associated with deployment activity the ultimate goal of the deployment activity is to make sure that working valuable software gets to the customer as quickly as possible typically companies will use a ticketing system to control and monitor the work that needs to be done in deployment artifacts will be prepared for deployment computing instances will be provisioned sometimes the provisioning might involve creating virtual computing instances such as a virtual machine or container other times it might require installing physical hardware such as computers and networking devices then after provisioning is complete the deployment artifacts are configured and pushed into relevant computing environments and finally we get to operations it's important to understand that a comprehensive ci cd system such as team city goes beyond just deployment activity team city will also automate a lot of operations activity release personnel can use team city features to orchestrate computing environments and monitor activity in those environments also it coordinates important aspects of enterprise level devops such as logging and aggregating security alerts security is a critical aspect of any enterprise's operation and is a particular concern to any devops practitioner working within the enterprise overview and features of jenkins jenkins as a continuous integration tool jenkins is a java based open source automation tool it functions as a server and is a software development and cross-platform tool used for continuous integration and continuous deployment let's look at what jenkins can do as a continuous integration server it can be used as a ci server or a continuous delivery hub for a project in terms of distribution it can easily distribute work across different machines and help trigger builds tests and deployments to multiple machines and platforms quickly jenkins is designed to work cross-platform it allows programming in software development environments such as ios.net android ruby and java architecture of jenkins jenkins is a comprehensive cicd framework that is designed to be flexible and extensible it has a distinct object model that has classes like project and build these classes describe the various components of the framework it uses jelly as the view technology it uses the file system to store its data directories are created at the location on disk defined by the environmental variable jenkins underscore home it supports plugins which are plugged into those extension points and extend the capabilities of jenkins popular features of jenkins let's take a look at the features one jenkins is platform independent two it has a rich plugin system three it has the support of a large community of third-party developers and expert users four it's designed to scale to meet the needs of the large enterprise five its automation capabilities enable immediate detection and resolution of issues six it's open source and user friendly and seven it's easy to configure modify extend build status and job health every time a jenkins job runs the status of the build gets reported the figure on the left side of the slide shows the results of a few runs of a build project notice that the result of each build is reported sometimes the build succeeds other times it fails if an administrator aborts or disables the build that gets reported too the figure on the right side of the slide provides a description of the overall health of the project according to many builds assisted practice set up jenkins let's take a look at the assisted practice you are given a project to install and configure jenkins on the ubuntu operating system of your learning lab virtual machine lab 3.1 installing and configuring jenkins in this demo we're going to describe three steps to install and configure jenkins first we're going to modify the file sources dot list then we're going to use app get to install the jenkins package and then finally we're going to run jenkins in the browser so let's get started first at the command line we type make dir lab 3.1 then at the command line we type cd lab 3.1 to navigate into the directory we've just created now we need to add the key from the jenkins package repository into our local environment at the command line we type w get dash q dash o https colon slash slash package dot jenkins dot io slash debian dash stable slash jenkins dot io dash key pipe sudo apt dash key add dash and this will add the key directly into the app get file system now we need to update the file sources.list we'll use the vi editor that's already installed in your classroom virtual machine at the command line we type sudo space vi space forward slash etc forward slash apt forward slash sources dot list sources sources.list is the file that apt-get uses to locate package repositories on the internet we strike the i key on the keyboard to put vi into insert mode we scroll down to an empty space in vi and type deb https colon forward slash forward slash pkg.jenkins.io forward slash debian dash stable space binary forward slash then we hit the escape key to get out of insert mode and type colon w for write q to quit vi now we have to update the package manager at the command line we type sudo apt-get space update update executes once we see the line reading package lists dot dot done the update is complete now we need to see if java is installed and if not we need to install it at the command line we type java space dash version as you can see java and the java development kit is already installed if java was not installed you would type sudo space apt-get space install space o p e n j d k dash seven dash j o j r e this command will execute app get to install the open jdk package now we install jenkins type sudo space app dash get space install space jenkins strike the y key to confirm installation the installation process will take a few seconds now we're going to open the initial installation of jenkins in a browser we go back to the virtual machine desktop in this case we'll load the firefox browser we're going to enter the ip address of the jenkins installation the ip address was assigned to the virtual machine earlier in the address bar of the firefox browser we enter the ip address 172.31.26.234 colon 8080 8080 is the port where the jenkins server is running please be advised the ip address of your virtual machine will be different and the way you can discover the ip address is at the command line type ifconfig the ip address of your virtual machine will be in the information displayed the first screen we're shown is the unlock jenkins screen we're going to need to enter the administrator password in order to continue as you can see in the red type the location of the password is a file slash var slash live slash jenkins slash secrets slash initial admin password where initial admin password is the name of the file that contains the password we return to the terminal we type clear to clear the screen at the command line we type sudo space cat space forward slash var forward slash live forward slash jenkins forward slash secrets forward slash initial admin password we strike the enter key to display the password we highlight the password in the terminal and then copy it by right-clicking on the mouse and selecting copy we return to the browser and paste the password into the administrator password text box then we click the continue button firefox will offer to save the password but we'll click don't save we have the option to install suggested plugins or we can select specific plugins to install we're going to go with the install suggested plugins method we click the box labeled install suggested plugins the getting started page appears and the plugin installation continues once downloading and installing the plugins is complete you'll be presented with the create first admin user page at this point we've successfully installed jenkins now the next steps will be to create the admin user by putting in a username password confirmation of password a full name for the user and the user's email address let's recap the important steps assisted practice guidelines to install and configure jenkins log into ubuntu lab provided with the course open the terminal and execute the command available in the lab document 3.1 to add the key to the system edit the sources.list file and add the command to the file and then save it update the apt-get package install jdk 8 plus version install jenkins using app get package navigate to the ip address of the machine denoted as x point x point x point x colon 8080 in the browser of your virtual machine get the password and enter it into the jenkins window create a new role job in jenkins explore the freestyle project and build section overview and the features of team city team city as a continuous integration tool teamcity is a java based management and continuous integration server it's licensed commercial software that's used for continuous integration and continuous deployment teamcity supports a number of features that are important to the continuous integration process for example gated commits ensure only working code is committed to deployment branches and source control teamcity supports integration with various integrated development environments such as eclipse and intellij it has a build grid that describes build activity also it has cross-platform support for a variety of operating systems and programming languages also teamcity has seamless code integration teamcity workflow teamcity supports the cicd process that has become the standard workflow for many companies and software development shops let's take a look at the overall workflow as you can see in the slide at point 1 the first step is that a developer or tester checks code in to the source control management system upon commit at point 2 a build trigger message is sent to the team city server then at point 3 team city works with system unit testing to start the system unit testing automation process if the code passes the tests artifact building archiving and deployment tasks are performed in an automated manner at point 4. teamcity reports the status of all the activities at point five popular features of team city team city has many features that make the cicd process more efficient let's take a look at the features teamcity has pre-tested commit instant notifications it has code coverage and monitoring capabilities it provides a comprehensive build infrastructure and it has enhanced version control system integration team city makes it easy to verify code and it offers configurable test reports and finally team city supports managing users and roles assisted practice set up team city now it's time to do an assisted practice to set up team city you're going to be given a project to install and configure team city on the ubuntu operating system in your learning lab virtual machine so let's get started with lab 3.2 install and configure teamcity first we create a directory for the work we type mkdir lab 3.2 then we navigate to that directory by typing cd space lab 3.2 first we're going to download the compressed gz file for teamcity then we're going to extract the files from the compressed file we're going to move the extracted directory that contains the files into another location we're going to start up teamcity and then we're going to go to the browser and register a user with teamcity let's download teamcity we go to the desktop of our classroom virtual machine and then we click on the icon for google chrome chrome appears in the chrome address bar we type dot www.jetbrains.com forward slash team city forward slash download we click the download button the gz file downloads and the thank you page appears we return to the terminal at the command line we type cd space forward slash home forward slash ubuntu forward slash capital downloads forward slash we strike the enter key this takes us to the directory where the gz file has been downloaded at the command line we type ls to confirm that the gz file is indeed in the directory notice the file teamcity-2018.2 is listed now we need to extract the files at the command line we type tar space zxvf space teamcity-2018.2.1.tar.gz and we hit the enter key this will extract all the files into a directory named team city now we need to move the directory team city into the directory forward slash opt forward slash jet brains we create a directory by typing pseudo space mkdir space forward slash opt forward slash capital jet capital brains now we need to move the directory team city into the directory forward slash opt forward slash jet brains at the command line we type sudo space mv space team city space forward slash opt forward slash jet brains forward slash team city we strike the enter key now we need to give full read write and execute permissions to the files in the newly created directory team city at the command line we type cd space forward slash opt forward slash jet brains we strike the enter key then we type chmod space dash capital r 777 team city forward slash this says to give all rights to the directory and the contents of the directory team city we type ls just to make sure the directory team city is indeed there we type cd space team city forward slash and hit the enter key to enter the directory team city then we type ls to take a look at the contents of the directory team city notice there is a bin directory we navigate into the bin directory by typing cd space bin and hit the enter key let's clear the screen to make things easier to see to invoke team city we will execute the bash file dot forward slash team city dash server dot sh space start it's very important that you use the dot forward slash characters we hit the enter key and team city starts up spawning team city and then team city restarter running with pid11618 and the pid the process identifier will vary according to systems now team city is running we go back to the browser but before we do take notice of the ip address of the virtual machine which is shown on the command line on the left hand side the ip address of this virtual machine is 172.31.26 in the address bar of the chrome browser we type 172.31.26 colon 811 which is the port on the ip address where teamcity is running the team city first start web page appears we click the proceed button the team city is starting page appears then we see the database connection setup page teamcity allows you to choose from a variety of databases we can use postgres mysql oracle or ms sql server we're going to use the internal database teamcity creates the database and initializes its server components this phase of the setup can take a few minutes the page will reload automatically once team city is through installing its server components we're almost done with teamcity's installation process then all we'll need to do is to create an account in teamcity when the installation process is complete we'll be presented with the licensing agreement that we have to agree to we scroll to the end of the terms and conditions we click the check box for accept license agreement we're going to uncheck send anonymous usage statistics then we'll click the continue button the web page create administrator account appears we enter the username simply learn then we add a password and confirm the password finally we click the button create account we'll also save the username and password information in google chrome upon successfully entering a username and password will be presented with the my settings and tools web page in teamcity the page allows us to access projects and changes and agents as well as build cues in the next demo we'll look at more details let's recap the important steps guidelines to install and configure teamcity number one log in to ubuntu lab provided with the course number two download team city from the official site three unzip the folder and install team city four provide the read write and execute mode access to siem city number five run team city at x dot x dot x dot x colon eight one one one where x dot x dot x dot x is the i p address of your local machine or the machine where the server is running six create an account in team city and add the basic details to complete the setup process seven explore options such as projects changes agents and build queue build tools and their uses build tools build tools are programs that automate the creation of applications from source code automation tools allow the build process to be more consistent some common build tools are make bash which ships with linux and apache maven for java grunt and gulp popular features of build tools well we can start with compiling to binary code for languages such as c-sharp and java build tools will package a compiled program for deployment also it will run automated test cases against the code the build tool will deploy artifacts to production and also generate documents for developers to use for later reference and finally a build tool will generate release notes an overview of apache ant apache ant is a java library and command line tool its aim is to provide processes described in build files as targets and extension points dependent on each other let's take a look at some of the distinct features apache ant supplies a number of built-in tasks that allow it to compile test and run code it's flexible and does not impose coding conventions it builds solutions by combining build tools and dependencies with apache ivy it solves makes portability problem and users can develop custom ant lives using java and finally you can use ant to pilot any type of process the limitations of apache ants in apache and there are a few limitations some of the limitations are number one configuration error checking is limited undefined properties are not raised as errors but are left as unexpanded references number two and has limited fault handling rules lazy property evaluation is not supported thus you need to be very exact when configuring it it is not a forgiving environment number three older tasks use default values which are not consistent and can cause problems you need to pay attention changing defaults can break existing ant scripts and finally number four and build files are complex and verbose as they are hierarchical and partly ordered an overview of maven apache maven is a comprehensive software project management tool based on the project object model also known as the pom maven can manage a project's build reporting and documentation from a central xml file let's take a look at the key points of maven number one is backward compatibility and auto parent versioning the hierarchical structure of the palm xml file reduces the burden on version control and reconciliation of dependencies number two maven supports model based builds number three maven supports parallel builds and better error integrity reporting you can kick off a number of project builds that run asynchronously number four release management and distribution publication is built into maven the project object model is comprehensive and covers all aspects of the software development life cycle from development through testing and onto release number five instant access to the latest features with less or no additional configuration may even allows artifact version control that can be set to get the latest release of a dependency thus you can make sure the code is always up to date 6. large and growing repositories there is a complete ecosystem of maven artifact repositories that make it so you have access to popular components automatically the maven repository found at https slash mavenrepository.com is a popular one also a company can set up its own private repository the drawbacks of maven maven does have some drawbacks number one unable to depend on outcome status maven builds can fail leaving nothing behind other than error messages that can be very hard to understand number two maven is verbose and complex it does take a while to master the details of the platform number three slow and partial black box maven does a lot of things automatically and sometimes these black box activities can be very opaque and finally number four maven can be unreliable when integrated for use within the eclipse ide comparing maven over ant well maven has better dependency management it provides more powerful builds there's better collaboration and the debugging capabilities are a bit better than ant there's more componentization in the builds and there's reduced duplication and finally the palm provides a more consistent project structure the project object model also known as the pom the project object model is an xml representation of a maven project it provides general configuration information such as a project's name its owner and its dependencies on other projects the xml excerpt in the slide shows a rudimentary implementation of maven's project object model the palm xml needs to define the group id the artifact id and version the packaging needs to be declared too the default deployment package is a jar the project described in the xml file in the slide has an artifact idea of calculator you can think of the artifact id as the name of the artifact that's going to be created the pom shows a version of 1.0 and it belongs to the group with the identifier eu dot total eclipse you can think of the group id as a way a company organizes a number of artifacts under a common name overview of grunt grunt is a javascript-based task runner which is used to automate repetitive tasks in a workflow it can be used as a command line tool for javascript objects let's take a look at some of the key points to understand about grunt in grunt developers write grunt setup files to ease workflow thus grunt speeds up the development flow and enhances performance it helps with the automation of repetitive tasks with less effort it supports a small infrastructure which is a best fit for new code bases grunt minifies files such as html and css thus reducing the potential problems with network latency grunt aims at reducing the chances of errors during repetitive tasks and it includes built-in tasks to extend functionality of plugins currently grunt has over 4000 plugins and can be used in large production sites an overview of gulp gulp is an open source javascript tool kit used as a build system in front end web development it automates time consuming and repetitive tasks involved in development some of the key features of grunt are code minification and concatenation usage of pure javascript code grunt converts files created under less or sas in a css compilation process less which stands for leaner style sheets is a dynamic preprocessor style sheet language that can be compiled into cascading style sheets also known as css and these style sheets are run on the client side or the server side sas is a pre-processor scripting language that is interpreted or compiled into cascading style sheets grunt also manages file manipulation in memory some of the advantages of grunt are that it's easy to code it's easy to test with web apps and the plugins are simple to use some of the disadvantages of grunt are there's a more than the usual number of dependencies multiple tasks cannot be performed in parallel and configuration can become tedious assisted practice continuous integration with jenkins and maven you were given a project to configuring jenkins you need to make jenkins poll get commits and build a project code using maven on the ubuntu operating system on your practice lab vm okay so let's get started with lab 3.3 continuous integration with jenkins git and maven in this lab we're going to configure jenkins to support get and maven then we're going to configure a maven project and then finally we're going to build the maven project using source code from get so in a web browser we open jenkins and what we do in our classroom virtual machine is we go to the ip address and in this case it's 172.31.26.234 colon 8080 and jenkins typically runs by default installation we click the new item link which is on the upper left of the jenkins web page the new item webpage appears in the new project text box we enter the project name in this case java maven then we select freestyle project then scroll down the web then scroll down the web page and click the ok button on the left hand side the web page for the newly created project loads we add text to the description text box this is a simple project to test jenkins we go to the menu bar at the top of the projects web page and we click the build tab we're taken to the build section of the web page we click the add bill step button to display a drop down of options from that drop down list we select the item execute shell in the command text box we enter the linux command echo space quotation mark hello space from space jenkins quotation we click the save button on the lower left now we'll do a test build to make sure everything's working all right on the left hand side of the project web page we click the link build now the build starts and when it completes you'll see a blue circular icon in the build history section of the project web page on the left side and you can see there's a build there and it's labeled number one to the right of build number one is a drop down arrow which we click to get a list of options and we select console output selecting console output will display in the web page the build log activity notice there's a line that says hello jenkins this is from the echo command we entered in the jenkins build configuration let's develop the project a little more what we need to do is to add get integration and get the project to work with maven we go to the simply learn site on github and that's simply learn devops official and we go to the repository java maven app on the github site we click the green clone or download button to display the url that we can use to access to access the java maven app repository on github so we highlight the url and copy it we go back to the jenkins web page in the jenkins web page on the menu bar we click the tab for the java maven project the java maven project appears on the left side of the project's web page we click the configure hyperlink this loads the project's configuration page in which we click the source code management tab we're navigated to the source code management section of the configuration page there we click the option get we paste the url of our simply learn java maven app repository into the text box repository url entering a valid url will make the error message please enter get repository disappear we're going to select some predefined credentials from the credentials drop down we added those earlier but if you need to add credentials in the future simply click the add button and then select jenkins now if you're using your own github repository you'll be presented with the jenkins credentials provider dialog you're going to need to enter your username and also your password once we configure access to the get repository we click the save button now what we've done is we've effectively given jenkins the right to access our github account using our credentials in other words jenkins is impersonating us after we save the get configuration we'll be brought back to the projects page we need to go back to jenkins home we click the jenkins tab on the upper left of the project page this takes us back to the main jenkins dashboard page which we can think of as home now we click manage jenkins on the left side of the jenkins homepage on the manage jenkins page we select global tool configuration the global tool configuration page appears we scroll down to the maven section of the global tool configuration page we click on a button add maven to add a maven configuration we're going to give this installation a name we're going to call it local maven then maven needs to know where its home is on the classroom virtual machine in the text box labeled maven underscore home we enter the value slash usr slash share slash maven an alternative method is to again click on add maven add a name this time maven and then from the install from apache drop-down select the version of maven that's on the machine we've now let jenkins know about maven so we can click the save button we return to the manage jenkins page we need to return to the project in the upper left hand corner of the manage jenkins page we click the jenkins button we're brought back to the jenkins main dashboard you can see java maven in the list of projects on the main dashboard when we hover over java maven we'll see a down arrow we click that down arrow and some options appear we select configure from the options drop down the java maven projects configuration page appears we click the build tab in the menu bar you can see the echo command that we created previously in the build section we want to get rid of it so what we're going to do is we're going to go to the right side of the execute shell section and click the red button with the x label clicking the red button deletes the execute shell command echo from the build section now we want to add a new build step we click the add build step button and we notice that another drop down appears from that drop down we select invoked top level maven targets after we add the maven build task we'll be presented with a maven version drop down this will contain the maven configurations we created previously we select one of the configurations in this case we'll select maven let's recap the important steps assisted practice guidelines to configure jenkins and maven number one log in to ubuntu lab provided with the course number two log into jenkins and create their first jenkins job number three install and configure maven number four configure jenkins with java get and maven number five create a jenkins job for your maven build project and run the project number six pull get for commits and automatically trigger the build number seven build the trigger using the push mechanism instead of pull number eight repeat steps six and seven multiple times to observe the results in the console output section now when we know the definition of both continuous delivery and continuous deployment let's see the contrast between the two we have drawn the contrast between the two on the basis of three major factors the three major factors are the definition of the two advantages that they both have and for whom or what kind of organizations use them let's begin with the first factor the first factor we have is the definition continuous delivery is a devops practice that looks forward towards releasing the code changes to the production after all the testing has been performed whereas continuous deployment is a devops practice that focuses on continuously deploying or releasing the code changes into the production environment then the second factor is advantages here we will see the advantages of the two continuous delivery is known for frequent releases while continuous deployment is known for completion of each deployment phase second advantage is continuous delivery is known to complete the releases in smaller segments while continuous deployment is known for quick and more reliable completion the next advantage in our list is continuous delivery is known for its instant response to defects and bugs whereas continuous deployment focuses on automating the entire process the final advantage of continuous delivery is that it is known for its comfortable stable and very reliable releases whereas continuous deployment is popular for the creation of fully automated ci cd pipeline the third considerable factor is for whom in this factor we will see what kind of organizations or companies use these two practices continuous delivery is used by organizations that need to release new features on a frequent schedule on the other hand continuous deployment is mainly used by organizations that look forward to releases on a daily or hourly basis the process of continuous deployment ensures cross-department coordination like development support marketing business etc now when we know continuous integration continuous delivery and continuous deployment it is important for us to understand how these three are related to each other in the diagram on the screen we can see the process of integration delivery and deployment in a simultaneous flow we can see that first the build is initiated which is then tested and in the next step it is merged these three steps together make continuous integration then after these three steps comes the next phase where the automatic release to the repository takes place and this is called the continuous delivery phase lastly the release reaches the phase where it is continuously released to the production and this step is known as the continuous deployment phase now to understand these better we shall see each of these phase one by one to understand their relation with the cicd pipeline the first phase in the cicd pipeline is the continuous integration phase the process refers to the integration of all the code changes into a shared repository continuously the process of continuous integration ensures that this code is tested and incorporated very smoothly after the integration phase comes the continuous delivery phase as the name implies the phase looks forward to delivering the changes being made in the code after several iterations and feedbacks in the continuous delivery phase the team finalizes what is to be deployed to the customers and when after the delivery phase comes the last phase that is the continuous deployment phase continuous deployment phase is the phase that is completely free from human interference there is a common goal that continuous delivery and continuous deployment share that goal is to automate the entire development process these phases are sometimes combined to each other to give the maximum productivity now let's talk about that why exactly as and we talk about at the industry level in the market level also that the ci cd is one of the best practices now what is the reason behind that why those are known as the best development and devops practices as such now continuous integration and continuous delivery are the best practices as they create an effective process the kind of integration and delivering the source code these are the prime things which we need to take care when we talk about the development uh teams over here so they want an automated process first of all and they also want to streamline process which can you know take up the things which should not fail it should be a fail-safe process mechanism through which they can release various kind of changes to the production environment because ultimately they are looking forward for the deployment of the changes to the production environment so how they are going to do that that is where the ci cd or the continuous integration and continuous delivery helps on that part and that's the reason why they can help the teams the development teams to go for an effective process implementations when we go for these implementations of these two practices small call changes can be easily made in the software course so you don't require much of the efforts if you are going for even small changes in the source code that can also be effectively deployed to a production environment in a simple straightforward and easy mechanism the changes can go from the developer machines to the production environment that's the biggest benefit which we get due to which we feel that yes these two processes should be implemented into a devops platform right so ca and cd provides continuous feedback from the customers and also from the development teams devops teams so the increase of transparency is also something which is important which is implemented with these processes here so the process enables faster release of the product so we don't have to wait for months to release the source code there within a couple of hours within couple of days we can actually release it to the production environment provided we do all these steps like build compilations testing development validation all these things will be done in that duration of time so the failures can be easily detected faster and uh you can easily find out that what is the problem with the code base what is the problem that changes and we can even do the hot fixes now hot fixes these kind of ad hoc changes are also can be easily deployed to a production environment within just a couple of hours there now with that we have come to an end on this ci cd fill course by simply learn if you have any queries regarding the topics covered in this particular tutorial or if you are looking for the code document which has been implemented in this particular tutorial then please feel free to reach us down in the comment section below and our team of experts will be happy to resolve all the queries until next time thank you stay
Info
Channel: Simplilearn
Views: 20,441
Rating: 4.8689957 out of 5
Keywords: ci cd pipeline, ci cd, ci cd pipeline using jenkins, ci cd tutorial, cicd full course, ci cd tutorial for beginners, ci cd pipeline automation testing, ci cd tools, continuous integration, continuous integration jenkins, continuous integration and continuous delivery, continuous delivery vs continuous deployment, what is continuous integration, what is continuous delivery, devops tools, jenkins, simplilearn devops, simplilearn
Id: h9K1NnqwUvE
Channel Id: undefined
Length: 87min 4sec (5224 seconds)
Published: Fri May 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.