DevOps Training Program that will provide you with in-depth knowledge of various DevOps tools including Git, Jenkins, Docker, Ansible, Puppet, Kubernetes and Nagios. This training is completely hands-on and designed in a way to help you become a certified practitioner through best practices in Continuous Development, Continuous Testing, Configuration Management and Continuous Integration, and finally, Continuous Monitoring of software throughout its development life cycle.
Here’s a portable bash script to disable the nonessential plugins we turned off (mercurial, theme-manager, dark-theme, pipeline-graph-view) on any Jenkins host:
echo "Done. Check status with: sudo systemctl status jenkins"
Save/run it on the Jenkins controller (or any similar instance) with sudo rights. It only creates .disabled markers for the listed plugins if present, then restarts Jenkins
Store and Encrypt Credentials in Jenkins (Access and Secret Key)
In this step, we will be storing and encrypting the access and secret key in Jenkins to maximize security and minimize the chances of exposing our credentials.
Go to Manage Jenkins > Manage Credentials > Click on Jenkins the highlighted link as shown below
Select Add Credentials
Choose Secret text in the Kind field
Enter the following below:
Note: Modify the yellow highlighted text with the right value.
You can connect to a running container just like you can connect to a server and then run commands in that container. To do that you have to make use of the docker exec command
The goal is to implement Devops best practices to run Terraform in Jenkins Pipelines. We will go over the main concepts that need to be considered and a Jenkinsfile that runs Terraform. The Jenkinsfile will consists of parameters that allows us to pass data as variables in our pipeline job.
Install Terraform on Jenkins Server
Install Terraform Plugin on Jenkins
Configure Terraform
Store and Encrypt Credentials in Jenkins
Setting up CD Pipeline with Terraform to Deploy App Servers
Bash Script to Deploy Artifactory
Run Pipeline Job
Install Terraform on Jenkins Server
Use the following commands to install Terraform on Jenkins server and move the binaries to the correct path as shown below.
Go to Manage Jenkins > Manage Plugins >Available > search Terraform as shown below:
As you can see, Terraform Plugin is already installed on my Jenkins hence why it's displayed in the Installed section.
Store and Encrypt Credentials in Jenkins (Access and Secret Key)
In this step, we will be storing and encrypting the access and secret key in Jenkins to maximize security and minimize the chances of exposing our credentials.
Go to Manage Jenkins > Manage Credentials > Click on Jenkins the highlighted link as shown below
Select Add Credentials
Choose Secret text in the Kind field
Enter the following below:
Note: Modify the yellow highlighted text with the right value.
Secret = EnterYourSecretKeyHere
ID = AWS_SECRET_ACCESS_KEY
Description = AWS_SECRET_ACCESS_KEY
Click OK
Add another credential and enter the following:
Secret = EnterYourAccessIDHere
ID = AWS_ACCESS_KEY_ID
Description = AWS_ACCESS_KEY_ID
Click OK
Configure Terraform
Go to Manage Jenkins > Global Tool Configuration > It will display Terraform on the list.
Enter terraform in the Name field
Provide the path/usr/bin/ as shown below
Setting up CD Pipeline for Terraform
Go to Jenkins > New Items. Enter terraform-pipeline in name field > Choose Pipeline > Click OK
Select Configure after creation.
Go to Build Triggers and enable Trigger builds remotely.
Enter tf_token as Authentication Token
Bitbucket Changes
Create a new Bitbucket Repo and call it terraform-pipeline
Go to Repository Settings after creation and select Webhooks