Jenkins VM by Anarion Technologies
Jenkins is an open-source automation server primarily used to automate tasks related to building, testing, and deploying software. It was initially developed as a fork of the Hudson project and has since evolved into one of the most widely adopted tools for continuous integration (CI) and continuous delivery (CD) in software development.
Jenkins operates by facilitating the continuous integration process, which involves the automatic merging of code changes from multiple contributors into a shared repository. This practice helps in early detection of issues and conflicts, leading to improved code quality and faster resolution of problems. The tool is designed to streamline and automate repetitive tasks, allowing developers to focus more on writing code and less on manual processes.
A standout feature of Jenkins is its extensibility through a vast ecosystem of plugins. These plugins enable Jenkins to integrate with a myriad of other tools and services, making it highly adaptable to various development environments and workflows. Jenkins pipelines, defined as code, allow users to script their build, test, and deployment processes in a clear, maintainable, and version-controlled manner.
Jenkins supports distributed builds, meaning it can spread workloads across multiple machines to optimize performance and reduce build times. This capability is particularly beneficial for large projects that require significant computational resources. The tool also provides a comprehensive user interface for monitoring the status of builds, viewing test results, and managing the configuration of jobs and pipelines.
To subscribe to this product from Azure Marketplace and initiate an instance using the Azure compute service, follow these steps:
1. Navigate to Azure Marketplace and subscribe to the desired product.
2. Search for “virtual machines” and select “Virtual machines” under Services.
3. Click on “Add” in the Virtual machines page, which will lead you to the Create a virtual machine page.
4. In the Basics tab:
- Ensure the correct subscription is chosen under Project details.
- Opt for creating a new resource group by selecting “Create new resource group” and name it as “myResourceGroup.”
5. Under Instance details:
- Enter “myVM” as the Virtual machine name.
- Choose “East US” as the Region.
- Select “Ubuntu 18.04 LTS” as the Image.
- Leave other settings as default.
6. For Administrator account:
- Pick “SSH public key.”
- Provide your user name and paste your public key, ensuring no leading or trailing white spaces.
7. Under Inbound port rules > Public inbound ports:
- Choose “Allow selected ports.”
- Select “SSH (22)” and “HTTP (80)” from the drop-down.
8. Keep the remaining settings at their defaults and click on “Review + create” at the bottom of the page.
9. The “Create a virtual machine” page will display the details of the VM you’re about to create. Once ready, click on “Create.”
10. The deployment process will take a few minutes. Once it’s finished, proceed to the next section.
To connect to the virtual machine:
1. Access the overview page of your VM and click on “Connect.”
2. On the “Connect to virtual machine” page:
- Keep the default options for connecting via IP address over port 22.
- A connection command for logging in will be displayed. Click the button to copy the command. Here’s an example of what the SSH connection command looks like:
“`
ssh [email protected]
“`
3. Using the same bash shell that you used to generate your SSH key pair, you can either reopen the Cloud Shell by selecting >_ again
or going to https://shell.azure.com/bash.
4. Paste the SSH connection command into the shell to initiate an SSH session.
Usage/Deployment Instructions
Anarion Technologies – Jenkins
Note: Search product on Azure marketplace and click on “Get it now”
Click on Continue
Click on Create
Creating a Virtual Machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
After Process of Create Virtual Machine. You have got an Option Go to Resource Group Click Go to Resource Group
Copy the Public IP Address
Click on the Network Security Group: jenkins-nsg
Click on Inbound Security Rule
Click on Add
Add Port
Destination Port Ranges Section* (where default value is 8080)
8080
Select Protocol as TCP
Option Action is to be Allow
Click on Add
Click on Refresh
Copy the Public IP Address
Browse to <http://IP_Address:8080>
(or whichever port you configured for Jenkins when installing it) and wait until the Unlock Jenkins page appears.“
In case IP address in not Working SSH in your
Virtual Machine and these following commands on your terminal:
$ sudo useradd -r -m -s /bin/bash jenkins
$ sudo chown -R jenkins:jenkins /var/lib/jenkins
$ sudo chown -R jenkins:jenkins /var/log/jenkins
$ sudo chown -R jenkins:jenkins /var/log/jenkins
$ sudo chown -R jenkins:jenkins /var/lib/jenkins
$ sudo chown -R jenkins:jenkins /var/log/jenkins
$ sudo chown -R jenkins:jenkins /var/cache/jenkins
$ sudo systemctl daemon-reload
$ sudo systemctl restart jenkins.service
$ sudo systemctl status jenkins
Browse to <http://IP_Address:8080>
(or whichever port you configured for Jenkins when installing it) and wait until the Unlock Jenkins page appears.“
Unlock Jenkins
$ cat /var/lib/jenkins/secrets/initialAdminPassword
Copy Administrator Password and paste it on browser
From the Jenkins console log output, copy the automatically-generated alphanumeric password (between the 2 sets of asterisks).
Note:
·
The command: sudo cat
/var/lib/jenkins/secrets/initialAdminPassword
will print the
password at console.
·
If you are running
Jenkins in Docker using the official jenkins/jenkins
image you can use sudo docker exec ${CONTAINER_ID or
CONTAINER_NAME} cat /var/jenkins_home/secrets/initialAdminPassword
to
print the password in the console without having to exec into the container.
On the Unlock Jenkins page,
paste this password into the Administrator password field and click Continue.
Note: The Jenkins console log indicates the location (in the Jenkins
home directory) where this password can also be obtained. This password must be
entered in the setup wizard on new Jenkins installations before you can access
Jenkins’s main UI. This password also serves as the default administrator
account’s password (with username “admin”) if you happen to skip the
subsequent user-creation step in the setup wizard.
ThankYou….