Let's say you have forgotten Jenkins admin password. How to reset or retrieve admin password? Here below are the steps for resetting Jenkins admin password:
1. Edit the Jenkins config.xml under /var/lib/jenkins to disable securityFlag by executing below command: sudo vi /var/lib/jenkins/config.xml
you need to disable security to Jenkins by below change 2. Find this <useSecurity>true</useSecurity> and change it to <useSecurity>false</useSecurity> 3. Restart jenkins by below command: sudo service jenkins restart 4. Access Jenkins now, click on Manage Jenkins, click on configure Global security
5. click on Enable security
6. Click on Jenkins Own user database option.
7. click on apply and save 8. Now click on Manage users, click on admin, click on configure
Artifactory is one of the popular binary repository managers. It is Java based open source tool, used for storing build artifacts and docker images.
Some of the key features of Artifactory:
Supports 27 different package types including helm charts, docker images regardless of tech stack.
A single source of truth for all your binaries
Integration with all CICD tools
role based authorization with teams to manage artifacts
you can create local, remote and virtual repositories
Artifactory can be integrated with many Continuous integration and Continuous delivery tools. Artifactory is mainly used by Ant, Maven and Gradle build tools. Let us see how to install Artifactory on Ubuntu 22.0.4 using Deb packages.
Pre-requisites:
VM needs to have at least 4GB RAM, for AWS choose at least medium instance type.
Default ports 8081 and 8082 needs to be opened. 8081 for Artifactory REST APIs. 8082 for everything else (UI, and all other product’s APIs).
Change Host Name to Artifactory sudo hostnamectl set-hostname Artifactory
Update Ubuntu OS sudo apt update
Add JFrog Artifactory APT repository
echo "deb https://releases.jfrog.io/artifactory/artifactory-debs xenial main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list
Import repository GPG key by running the following commands
Automating infrastructure setup in Azure Cloud using Terraform and Azure DevOps is a powerful approach to managing your infrastructure as code (IaC). This allows you to define and manage your Azure resources programmatically, version control your infrastructure configurations, and automate the deployment process.
We will be creating a Java based WebApp(app service) in Azure cloud using Terraform and automate the process using Azure Devops Pipelines.
Create storage account, container for Terraform to store state information in Azure cloud remotely.
Create pipeline and add Terraform tasks
Execute pipeline to deploy resources(App service plan and WebApp) in Azure cloud
Verify resources are created in Azure cloud
Confirm if the terraform.tfstate file is updated
Create Resource Group in Azure cloud
Login to Azure portal, Create a new RG, or you can skip this step if you already have existing group.
Create Storage Account in Azure cloud
Create a new resource, type storage account
Click on create
select RG, enter unique account name, select standard as performance, select locally redundant storage
Click on create
Create a container inside the storage account
Select the storage account you just created, click on containers under Data storage
enter a name for the container
Create a pipeline in Azure DevOps
Login to Azure Devops, select Pipelines, select use the classic editor to create a pipeline
Configure Pipeline with tasks
Add Terraform installer task to install Terraform on build agent
Add Terraform task
Configure the task
enter storage account, container, key information as below:
Add terraform tasks to plan, apply
Add Terraform task for plan
change the command to plan from drop down and also select azure subscription from drop down
Add Terraform task for apply
change the command to apply from drop down and also select azure subscription from drop down
Now verify to make sure if we have correct values in each/every task. Now click on Save + Queue.
Click on Save and Run
This confirms that pipeline have successfully created resources in Azure cloud. You can login to Azure portal to see the resources - app service plan and web app.
You can also verify terraform state info which has resources entry for all the resources created
Click on Containers, mytfstatecontainer
Click on terraform.tfstate
Click on Edit to view the content of terraform state file
Clean up resources created in Azure using the pipeline - destroy command
change the command to destroy instead of apply from the drop down
You can either add a new task for destroy or modify to destroy from apply in the existing task.
Now save the pipeline and run the pipeline. check the output of destroy task
Let's learn how to connect to a Virtual machine running in Azure cloud from your local machine. Your local machine can be a Windows laptop or MacBook laptop.
Pre-requisites:
1. Keys(for e.g., yourkey.pem) already downloaded in your local machine, preferably in downloads folder. 2. Azure VM is up and running 3. SSH client - for Windows laptop, you need to install an SSH client such as Git bash or putty. You can download Git from this URL - https://git-scm.com/downloads. For Apple laptop you need to download iTerm from here.
Windows Laptop instructions 5. Go to your local machine, Open Git Bash in Windows
make sure you are in downloads directory where your keys got downloaded. Type the below commands:
type below commands:
pwd
this should tell you which directory you are and then navigate to downloads dir.
cd ~/downloads
Now copy the value from Example in the above screen
ssh -i myAzVMKey.pem azureuser@104.43.214.12
and then type enter, say yes and enter
now you should be in Azure cloud, screen should show something like this, It means you are successfully connected to VM instance running on Azure cloud.
Mac Book Laptop or iMac Instructions
Open iTerm window, type the below command to go to downloads directory.
cd downloads
For few Mac laptops, it may add .txt in the end of pem file. in that case you need to remove .txt in the end
ssh -i myAzVMKey.pem azureuser@104.43.214.12
pwd and then execute below command to make sure the keys have only read permissions.
chmod 400 *.pem
6. Paste the url from example highlighted above in step # 4.
ssh -i myAzVMKey.pem azureuser@104.43.214.12
7. type yes when it is asking to connect.
8. now you should be in Azure cloud, screen should show something like this, It means you are successfully connected to VM instance running on Azure cloud.