Welcome to the Automatics Jenkins Setup and Deployment Guide. This document will walk you through the steps to set up and deploy Automatics applications using Jenkins, ensuring a smooth and efficient process.
Navigate through below stages to bring up Automatics Test System.
The recommended approach to deploy Automatics for a stable test environment is using 3 VM setup. In this approach the automatics components are deployed among the VMs. Following diagram shows in which VM each component should be deployed.
In this approach all components that is shown in the above section will be deployed in single VM.
Navigate through below stages to bring up Automatics Docker Containers.
Before you begin, ensure you have the following installed in VMs:
Virtual Machine (VM): VMs with root access.
Git: Installed on your Jenkins VM.
Docker : To be installed in all VMs where Automatics components has to be deployed
Self Hosted Maven Artifact Repository : (Optional)
This is where Automatics maven artifacts will be deployed and used during test execution using maven. If this setup is not available, please press enter for inputs asking maven artifact repo details. If planning to keep the artifacts in maven local repo in the same machine, please replace the command clean deploy with clean install in jenkins jobs configuration where ever applicable.
Please follow below steps to setup docker in your VMs.
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
Create a new user group named "docker" and add the Jenkins user to this group:
sudo groupadd docker sudo usermod -aG docker $USER
Log out and log back in to re-evaluate group membership. On a virtual machine, you may need to restart it. On Linux, you can also run:
newgrp docker
Verify Docker commands can be run without sudo:
docker run hello-world
Note: Ensure access to pull Docker base images like Tomcat and MySQL from Docker Hub. If access is not available, ensure these images are available locally on the Jenkins VM.
After the pre-requisites are done, clone the automated deployment repository in the VM where Jenkins is planned to setup.
Automatics Automated build and deployment Repo
Repo : https://code.rdkcentral.com/r/admin/repos/rdk/tools/automatics/dev-ops
(Please open the above url in browser and git clone url is available in the page)
Branch : rdk-next
Sub folder :
Clone the repository https://code.rdkcentral.com/r/admin/repos/rdk/tools/automatics/dev-ops(Please open the above url in browser and git clone url is available in the page) and navigate to the jenkinsServerSetup directory:
git clone <repository_url> cd dev-ops/jenkinsServerSetup
sudo from dev-ops/jenkinsServerSetup. This script installs Docker, pulls the Jenkins server image from Docker Hub, and installs necessary dependencies like Maven and Jenkins plugins. It also creates Automatics Core & RDKB Utils build jobs and build and deployment jobssudo sh install_jenkins_server.sh
During the installation, you will be prompted to specify whether you have a cloud-based Maven artifact repository.
If you have cloud Maven artifact repository, enter ‘Y’ and provide the URL of the private cloud Maven artifact repository along with the username and password.
If you do not have a cloud Maven artifact repository and want to configure a local Maven repository instead, enter ‘N’. In this case, the .m2 folder will be used by default as the local Maven repository inside the Docker container.
Below set of jobs will be created after successful setup of Jenkins.
First execute Automatics_Build_Job. This will build the source code of Automatics tools and services and generate war or jar files.
Populate the parameters as shown in the sample images.
Next, execute Automatics_Deployment_Job. This will create docker files and deploy dockers on the destination VMs. After this execution, Automatics tools should be up and running.
While running this job,
After successful docker deployment, please follow below manual configurations in Jenkins and Automatics tools.
Configure the jenkins jobs with below mentioned details
| Jenkins Job Name | Configuration to be done in Jenkins Jobs | Steps carryout the configuration |
|---|---|---|
| Automatics_Build_Job | No config needed | |
| Automatics_Deployment_job | No config needed | |
| CI_Automatics_Code_Deploy_And_3.0_Api_Parser | No config needed | |
| CI_Api_Parser_Automatics_Core | Add Automatics Properties Url in -Dautomatics.properties.file under Goal Section and Automatics Properties credentials in format 'username:password' and convert it to base64encoded and add as value to property -Dproperties.file.token. Note: if these values are populated as part of setup, then no manual update needed. |
|
| CI_Api_Parser_RDKB_Utils | ||
| CI_Api_Parser_RDKV_Utils | ||
| CI_Api_Parser_Scriptless_Automation | ||
| JOB1 | ||
| Deploy_Automatics_Core | No config needed | |
| Deploy_RDKB_Utils | ||
| Deploy_RDKV_Utils | ||
| Deploy_RPi_Partner_Java_API |
After completing the above set of configuration execute Jenkins Jobs in below order.
Configure devices in device manager
The below mandatory system configurations needs to be done in Automatics orchestration for running a first dummy Test execution and result verification from automatics. Please follow Automatics Orchestration Setup#Configuration to configure required configs System Config page of Automatics Properties to make use of features like scriptless automation, review management etc
All the URLs and DB credentials used for the deployment can be found as a YAML file in "archived artifacts" of Automatics Deployment Job execution DeploymentJob
| System Config Param | Description |
|---|---|
DEFAULT_SYNDICATION_PARTNER | Default syndication partner. Eg: Company name |
SYNDICATION_PARTNERS | Syndication partner names in comma separated format. Eg: Company name1, Company name2 |
DEVICE_INVENTORY_BASE_URL | Base URL which is having the rest implementation of device management |
EXECUTION_ENVIRONMENT_TYPES | Execution environment types in comma separated format. Supported values are RDKV, RDKB |
| AUTOMATICS_BASE_URL | Base URL of Automatics Orchestration Application |
| MICROSERVICE_URL | Base URL of Scriptless Service |
| JUN | Jenkins Admin User Name |
| JUP | Jenkins Admin User Password |
All the mandatory properties mentioned in the document Automatics Properties should be configured in automatics properties for the successful execution of a test case.
After all configuration are done, please login to the VM where debugger service is running and restart the debugger docker container.
docker start debugger-service-spring-boot-1
RDKB, RDKV 1.0 Scripts
RDKB , RDKV 3.0 Scripts
To validate that system setup is complete and good for execution. Please execute a simple test case as mentioned below and verify the steps.
For users upgrading from older versions of Automatics using the latest scripts, please note the following one-time activities:
automatics.properties and device_config.json files to the newly deployed application.To upgrade Automatics applications after a release using the latest automated deployment scripts: