Where Can You Find a Complete List of the Reserved Words for Declarative Pipeline Syntax?

Problem scenario
You want to create a Jenksinfile for a pipeline. Where can you find a complete list of the reserved words for Declarative pipeline syntax?

Answer
This external page has something close. It does not go into into how “sh” works. Using “sh” you can run Linux commands. There are “bat” and “powershell” options too. Here is an example (taken from Jenkins’ website) :

pipeline {
agent any
stages {
stage(‘Build’) {
steps {
sh ‘echo “Hello World”‘
sh ”’
echo “Multiline shell steps works too”
ls -lah
”’
}
}
}
}  » Read more..

How Do You Use the Docker Pipeline Plugin with Jenkins?

Problem scenario
You want to use the Docker Pipline (with the Jenkins ID of “docker-workflow”). What do you do?

Solution
Prerequisites
Jenkins needs to be installed. If you need assistance, see this posting if you are using a CentOS/RHEL/Fedora server; if you want to install Jenkins on a Debian/Ubuntu server, see this posting.

 » Read more..

How Do You Troubleshoot Triggers in a CI/CD Pipeline That Are Not Functioning?

Problem scenario
You are using Bitbucket and Jenkins. You have configured triggers to happen on certain events. The events have happened, but you see no corresponding action, no alerts or error messages and nothing in any relevant log. What should you do?

Possible solution #1
In Bitbucket, log in. Go to the relevant repository. Then go to Settings -Workflow -Hooks. Enable the “Post-Receive Web Hooks.” If this is disabled,

 » Read more..

How Do You Find the Version of Jenkins That is Installed on Debian/Ubuntu Linux?

Problem scenario
You inherited a Jenkins server running on Debian or Ubuntu Linux. You want to know what version of Jenkins you have. What do you do?

Solution
Run this command: dpkg -l | grep -i jenkins | awk ‘{print $3}’

 » Read more..

Do the Credentials “****” in Jenkins, Taken from the Credentials Plugin, Have the Username or the Password?

Problem Scenario
You want to use the credentials from the Jenkins credentials plugin in a Jenkins pipeline. When you assign the credentials to a variable in a pipeline, is it the username, the password, both or something else?

Solution
It is the username and password, but the two are separated by a colon. You will only see “****” in the console output (for security reasons).

 » Read more..

What is a Jenkins Executor?

Question
What is a Jenkins executor?

Answer
It is a designation in the Jenkins master server’s settings that governs resource allocation (e.g., CPU and RAM) on any Jenkins nodes and the master server itself. When a server (either the master or a node) is designated as having two or more executors, the server can process as many jobs simultaneously as the number of executors for which it has been designated.

 » Read more..

How Do You Create a Jenkins CI/CD Pipeline That Starts when Code is Checked into Atlassian Bitbucket?

Problem scenario
To trigger a Jenkins build after code is inserted into a Bitbucket repository, I have two options. I can use a Bitbucket plugin in Jenkins and do the configuration there. Or I can create a webhook in Bitbucket.

I tried both with a great deal of troubleshooting. But neither worked, and there was no error message. I found nothing in the logs. The triggering event clearly happened.

 » Read more..

How Do You Troubleshoot Jenkins Pipelines Not Running when You Try to Execute Them?

Problem scenario
Your Jenkins pipeline jobs will not run. You see “Build Scheduled” when you click on the “Build now” link. But nothing happens. You see an error that your /var/lib/jenkins/ is running low on disk space. You have no access to the back-end of the server that runs Jenkins. What should you do?

Solution
Look at the dashboard view. Next to the date and time of the most recent success of the job (build,

 » Read more..

What is a Jenkins Project?

Question
With the CI/CD pipeline, you hear about projects in the context of Jenkins. What is a Jenkins project?

Answer
A Jenkins project is a job. However, the term “job” is no longer used. Jenkins’ website defines a project as this: “A user-configured description of work which Jenkins should perform, such as building a piece of software, etc.” Taken from Jenkins’ website.

 » Read more..

What is a Jenkins Node?

Question
You have read about Jenkins nodes. Cloudbees uses the term.

You have heard of the term “Jenkins slave” servers (which are configured to use their CPU and RAM according to the main Jenkins server’s needs). What is a Jenkins node?

Answer
A Jenkins node is a Jenkins slave server.

The main Jenkins website defines a node as “A machine which is part of the Jenkins environment and capable of executing Pipelines or Projects.

 » Read more..