Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

This document will help you get clarity on the necessary steps required to Migrate JDK used in Automatics Framework and Utils (Automatics Jenkins, Core, RDKB and RDKV Utils, Partner Implementation) from JDK 8 to 11. The steps are segregated based on the user demographic

  • For existing partners who belongs to below categories
    1. Existing Automatics Jenkins and Framework setup is done manually
    2. Existing Automatics Jenkins and Framework setup is done using Automated Deployment scripts (Docker)

Upgrading Manually created Automatics Framework and Jenkins setup to JDK 11

For Automatics Framework and Utils to work after migrating to JDK 11 there are 2 different ways.

  1. Migrating both JDK and Jenkins server (Recommended)
  2. Only Migrating the JDK 

Migrating both JDK and Jenkins server

If you need to upgrade Jenkins as well as the JVM, we recommend that you:

  1. Back up JENKINS_HOME

  2. Stop the Jenkins instance

  3. Upgrade the JVM on which Jenkins is running

    • Use a package manager to install the new JVM.

      Code Block
      languagepowershell
      titleInstall JDK11
      linenumberstrue
      yum update 
      yum install java-11-openjdk-devel
    • Make sure the default JVM is the newly installed version. If it is not, run systemctl edit jenkins and set either the JAVA_HOME environment variable or the JENKINS_JAVA_CMD environment variable.

  4. Upgrade Jenkins to the most recent version

    • How you upgrade Jenkins is dependent upon your original Jenkins installation method.

    • We recommend that you use the package manager of your system (such as apt or yum).

    • If you have used a .war file for jenkins server, the download the latest .war file from Jenkins official website and replace that .war file with the existing one(Don't forget to keep a Backup of existing jenkins .war file.) (see .war file upgrade)
      • Download the latest Jenkins WAR file to an appropriate directory on your machine

      • Open up a terminal/command prompt window to the download directory

      • Replace that .war file with the existing one(Don't forget to keep a Backup of existing jenkins .war file.)
      • Run the command java -jar jenkins.war

  5. Validate the upgrade to confirm that all plugins and jobs are loaded

  6. Upgrade the required plugins (see Upgrading Plugins)

Only Migrating JDK

The below steps can be used to upgrade Automatics Tools to JDK 11 without upgrading Jenkins server.

  1. Upgrade the JDK on your Jenkins master node. You can use a package manager(yum , apt etc.) to install the new JVM. The last command will give the list of JDKs available in the VM along with its directory path

    Code Block
    languagepowershell
    titleInstall JDK11
    linenumberstrue
    yum update 
    yum install java-11-openjdk-devel
  2. Configuring multiple JDK in Jenkins server. After installing JDK 11, check whether JDK Tool plugin is available in the jenkins server. A typical Jenkins installation already includes the JDK Tool Plugin (now called Oracle Java SE Development Kit Installer). If not, go ahead and install it from the Jenkins plugin manager.

    A good indication that the plugin is installed can be found by going to Manage Jenkins > Global Tool Configuration and locating the JDK section.

  3. Now Click the button Add JDK and Untick Install automatically option 
  4. Enter the name of the JDK and path of the corresponding JDK in the respective fields. You need to configure both JDK 8 and JDK 11 here.
  5. Now Click Save at the bottom.

Upgrading Automatics Framework and Jenkins setup created using Automated deployment to JDK 11

Below steps can be followed to upgrade Automatics Framework, Utils and Jenkins server using Automated deployment

  1. Clone or Pull the latest Automatics Dev-Ops repo(see Repo Details) to the Jenkins Server VM
  2. Find "upgrade_jenkins_server.sh" inside the repo directory "/dev-ops/jenkinsServerSetup"
  3. Run the shell script with sudo and Input the user and existing jenkins server port when prompted.
  4. Once the shell script is fully executed successfully, validate the upgrade to confirm that all plugins and jobs are loaded