Versions Compared

Key

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

...

  • To perform test execution.
  • To deploy Automatics Core to maven artifact repository.

Jenkins Setup

Steps to be taken care during Jenkins configuration

  • Install Java 1.8

    • Refer following web page to get detailed steps to install Java 1.8 on Linux.

Automatics

...

  • Install Jenkins

Follow below steps to install and configure Jenkins in Linux

    • Enable the Jenkins repository. To do that, import the GPG key using the following curl command.

"curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo"

Sample Output:

Image Removed

    • And add the repository to your system with:

"sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key"

...

"sudo yum install jenkins"

    • After the installation process is completed, start the Jenkins service with:

"systemctl start jenkins"

To check whether it started successfully run:

"systemctl status jenkins"

Sample Output:

Image Removed

    • Finally enable the Jenkins service to start on system boot.

"sudo systemctl enable jenkins"

  • Setting Up Jenkins

    • To set up your new Jenkins installation, open your browser and type your domain or IP address followed by port 8080:

"http://your_ip_or_domain:8080"

    • A screen similar to the following will appear, prompting you to enter the Administrator password that is created during the installation.

Image Removed

    • Use the following command to print the password on your terminal.

...

jenkins

...

setup documentation can be found in the page : Automatics Jenkins Setup

Jenkins Deployment

...

You should see a 32-character long alphanumeric password.

    • Copy the password from your terminal, paste it into the Administrator password field and click Continue.
    • On the next screen, you will be asked whether you want to install the suggested plugins or to select specific plugins. Click on the Install suggested plugins box, and the installation process will start immediately. 

Image Removed

Image Removed

    • Once the installation is complete, you will be prompted to set up the first administrative user. Fill out all required information and click Save and Continue.
    • On the next page, you will be asked to set the URL for the Jenkins instance. The URL field will be populated with an automatically generated URL.
    • To complete the setup confirm the URL by clicking on the Save and Finish button.
  • Follow below steps to Disable CSRF protection by setting system property 'hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION' set to true. More details available at https://www.jenkins.io/doc/book/security/csrf-protection/ .

    • To disable CSRF it can be done with groovy  , Navigate to  "Manage Jenkins > Script Console " in Jenkins.
    • Enter the list of commands shown in the below screenshot and click on "Run".

Image Removed

  • Install Maven 3

Refer following webpage to setup Maven 3 on Linux.

Automatics Orchestration Setup#Maven3

Jenkins Job for Test Execution

Automatics performs test execution in Jenkins. Following page will provide details on creating Jenkins job for test execution.

Jenkins Job for Test Execution

Jenkins Job for Automatics Core Deployment

As part of Automatics setup, partner has to deploy automatics core in their own self hosted maven artifact repository. Automatics-core artifact to be deployed will be generated in format format 'automatics-core-{version}.jar'.

Following page will provide details on creating Jenkins job for Automatics Core deployment.

Automatics Core : Jenkins Deployment Job configuration

1.Creating Jenkins job

  • From Jenkins, select “New Item”,
    Image Removed
  • Specify name of the new job to be created.
  • Select ‘OK’ button.

2. Configuration of Jenkins Job

Configure General Settings

  • In ‘General’ settings, add proper description in the ‘Description’ section
  • Check ‘Discard old builds’ checkbox

Configure Source Code Management

  • In ‘Source Code Management’, select git and under ‘Repository’ add the repo detail

 eg : ‘https://code.rdkcentral.com/r/rdk/tools/automatics/automatics-core’ and also add the repo credentials

Image Removed

  • Also add the branch of the repository in ‘Branches to build’

    eg : */rdk-next

    Image Removed

Configure Build Triggers

  • In build triggers section select ‘Poll SCM’ and enter the schedule. By this configuration, there will be a polling to the repo for any changes periodically and if there are any changes then the Jenkins build will be executed

    Eg : @hourly means the job will check for any changes in the remote repo for every 1 hour and if there are any changes, then the build will run

    Image Removed

Configure Build Environment

  • In ‘Build Environment’, select ‘Delete workspace before build starts’
    Image Removed

Configure Build Settings

  • In the ‘Build’ settings, Click on ‘Add build step’ and Select ‘Invoke top-level Maven level targets’

           Image Removed

  • Add the following maven step in the text box
    clean deploy -DaltDeploymentRepository=<id>::default::<Artifact repository path>
    altDeploymentRepository – Specifies an alternative repository to which the project artifacts should be deployed
  • Click on Advanced button in ‘Invoke top-level Maven level targets’ and add following maven configuration. In the image shown below, maven settings.xml is place at /mnt/maven directory.  Update the settings.xml path based on its location in partner's VM.

           Image Removed

           Reference - https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html

Save the Configuration

  • Click on ‘Apply’ and ‘Save’

Jenkins Deployment Pipeline

Table of Contents

...

TermDescription
PipelineThe pipeline is a set of instructions given in the form of code for continuous delivery and consists of instructions needed for the entire build process. With pipeline, you can build, test, and deliver the application.
NodeThe machine on which Jenkins runs is called a node. A node block is mainly used in scripted pipeline syntax.
StageA stage block contains a series of steps in a pipeline. That is, the build, test, and deploy processes all come together in a stage. Generally, a stage block is used to visualize the Jenkins pipeline process.
StepA step is nothing but a single task that executes a specific process at a defined time. A pipeline involves a series of steps.


RDK-M Jenkins URL 

URL: https://rdkauto14automatics-jenkins.ccprdkcentral.xcal.tvcom:8443/


  • Click on New Item in the Jenkins dashboard.

...