Automatics Setup StepsNavigate through below stages to bring up Automatics Docker Containers. 
Pre-requisitesBefore 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.
Docker Setup StepsPlease 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: Verify Docker commands can be run without sudo: 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.
Clone Automated Deployment RepositoryAfter 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 : - Build : automationScripts\build\
- Deployment : automationScripts\deployment\
- Jenkins Setup : jenkinsServerSetup\
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 |
Setup Automatics Jenkins
Execute the installation script as sudo from dev-ops/jenkinsServerSetup: sudo 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 one, 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. 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 jobs.
 During script execution, provide inputs such as the port for the Jenkins server. After setup, access Jenkins via the browser using the public IP and port (e.g., 192.168.91.44:8909). Configure Jenkins security: - Go to "Manage Jenkins" → "Security".
- Under Security Realm, select Jenkins’ own user database.
- In the Authorization section, select "Logged-in users can do anything".
- Unselect "Allow anonymous read access".
- Click "Save".
Modify the necessary configurations in the pre-created Jenkins jobs (e.g., Maven repo URL, shell script file paths). - Add the user credential under Manage Jenkins->Credentials->System→Global Credentials.

Below set of jobs will be created after successful setup of Jenkins. 
Execute Automatics Build JobFirst 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.  
 
- Tick the checkbox like "BUILD_AUTOMATICS_ORCHESTRATION" for the orchestration build. You can tick or untick checkbox against each Automatics application to build the corresponding docker container
- Provide the repository URL, branch, and credentials for each Automatics project.
- Click "Build" to start the build.
Execute Automatics Deployment JobNext, 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, - Provide details of the VMs for deploying each tool, including user details for SSH access.
- Ensure SSH connection to the Jenkins VM for executing commands and copying Docker images.
- Select the tools to deploy and click "Build".
- Check the logs to ensure that deployment was success.
- The tools and services deployment urls are available at the end of the console log. 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
|