Versions Compared

Key

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

...

Automatics Automated build and deployment Repo

Repo : https://code.rdkcentral.com/r/admin/repos/rdk/tools/automatics/dev-ops

Branch : rdk-next

Sub folder : 

  • Build : automationScripts\build\
  • Deployment : automationScripts\deployment\
  • Jenkins Setup : jenkinsServerSetup\

Pre-Requisites

Jenkins Server Setup :

  1. A VM should be available and an user with root access should be available
  2. Git should be installed in the VM.

Build & Deployment of Automatics: 

  1. A VM should be available and Jenkins server should be installed in it.
  2. Also the below applications should be installed in the VM.
    1. Docker -  The sample shell script can be referred for installing docker - https://get.docker.com/
    2. Maven - version 3
    3. JDK - 1.8
  3. Create a new user group in the VM named "docker" and add the Jenkins user to this user groups the below commands can be referred for the same
    1. Create the docker group.

      $ sudo groupadd docker
      
    2. Add your user to the docker group.

      $ sudo usermod -aG docker $USER
      
    3. Log out and log back in so that your group membership is re-evaluated.

      If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.

      On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.

      On Linux, you can also run the following command to activate the changes to groups:

      $ newgrp docker 
      
    4. Verify that you can run docker commands without sudo.

      $ docker run hello-world
      

      This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

  4. Access to pull the docker base image like tomcat, mysql from dockerhub should be available. If access cannot be provided then those images should be available locally in the Jenkins VM for building docker images of Automatics tools.

Jenkins Server Setup

  1. Clone the above repo and go to the directory "jenkinsServerSetup\"
  2. Here you will find a file named "install_jenkins_server.sh" 
  3. Execute this shell script. This will install Docker and pull the Jenkins server image from docker hub 
  4. Then it will install all the necessary dependencies link maven, and Jenkins plugins.
  5. Also Automatics Core & RDKB Utils build jobs as well as Build and Deployments jobs will be created.

Jenkins Pipeline Manual Setup

  1. Login to Jenkins webpage
  2. Click on New Item button at the Left hand side menu
  3. Now Enter the name of the pipeline job and select pipeline option from below and click OK, as shown in the image below
  4. Navigate to the pipeline menu in the options and select "Pipeline script from SCM" in the drop down menu under the header definition. Then select the option Git for SCM. After that provide the Repo URL credentials and the branch. Then click save
    1. when adding the script path the path to the Jenkinsfile from the home directory of the repo should be provided. For the example the home directory of the repo is "/home/automatics/" and the location of Jenkins file for build job is "/home/automatics/automationScripts/build/Jenkinsfile" then the script path should be entered as "automationScripts/build/Jenkinsfile"

...