DevOps Classroom Series 13/Feb/2021

Maven contd..

  • Maven Parent POM (Super POM) is used to structure the project to avoid duplicate configurations
  • When developing a complex project we might create multiple sub projects
    • In the parent pom we would be mentioning the packaging type as pom Preview
    • In the child pom you would specify the parent structure Preview
    • Now to build this project all the childs will be built
  • Now lets integrate maven to run on jenkins server Preview
  • The job fails as maven is not installed on this machine Preview
  • Now install maven on the server where jenkins is installed
sudo apt install maven -y

Jenkins Free Style Project

  • Free Style is a legacy jenkins project type.
  • This project has six sections
    • General:
      • This section has basic description about project
    • Source Code Management:
      • This section defines the source code management or version control of the project code
      • By default jenkins will have git plugin installed, so we will see two options none and Git.
      • If you require other VCS systems
        • install vcs on the node
        • install vcs plugin on jenkins ui
    • Build Triggers:
      • Basically focused on when to build a project
    • Build Environment
    • Build
    • Post Build Actions Preview
  • Lets try to create a jenkins free style project to build spring petclinic
    • every time developer submits the code to git
    • Show the test results
    • Give an option to download the package
  • Solution:
    • Try to fork spring petclinic from Refer Here to your account
    • Create a free style project with any name Preview
    • Now specify the git source code details Preview
    • Now lets go to the build section and use invoke top level maven targets Preview
    • Now lets navigate to the build triggers section and use poll scm Preview
    • Now lets save the project and create a dummy push in the github repo Preview Preview
    • Now the build will be triggered Preview
    • Now lets configure this project to show the unit test results. Navigate to Post build actions => Publish Junit test results Preview Preview
    • Now build the project and observe the project page after build is finished Preview Preview
    • Now lets give an option to show the projects primary artifact (project packaging format). Navigate to Post Build actions => Archive the artifacts Preview Preview
    • Now save and build the project Preview

Configuring Jenkins

  • In this section we will learn some basic jenkins administration tasks
    • Jenkins Plugin Management
    • User Management in Jenkins
    • Performing backup/restore in Jenkins

Jenkins Plugin Manager

  • Jenkins plugins are pieces of software that upon installation will enhance the jenkins functionality
  • To view the Jenkins Plugins Preview Preview Preview
  • To install the plugin navigate to available section and search for plugins and install them
  • Manually Installing a Jenkins Plugin
    • Jenkins plugin will be in the format of .hpi (hudson plugin interface) or .jpi(jenkins plugin interface)
  • Plugin might require jenkins restart to work. Jenkins Plugin adds the functionality.
  • Plugins might add functionality in the
    • Jenkins Job Configurations
    • Jenkins Management Configurations

Jenkins Backup and Restore

  • In Jenkins all the configuration is stored in Jenkins Home directory.
  • If we want to backup jenkins just take the backup of Jenkins home directory
  • We can apply various approaches for taking the backup of jenkins home directory (/var/lib/jenkins)
    • write a cron job to take the backup of jenkins periodically
    • Use rsync
    • Use Jenkins Periodic Backup Plugin
  • Install Jenkins periodic backup plugin Preview
  • Navigate to Manage Jenkins => Periodic Backup Manager Preview Preview
  • Now configure the settings and create backup
  • Once backups are available, we can restore from backups

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner