Jenkins Key points — part 2

Lamai Anthony
3 min readApr 24, 2023

--

On the Jenkins dashboard, you can see a list of your current projects with a submenu. You can easily access each project’s build history, configuration, and other details.

Under the Manage Jenkins menu, you can access several important features. For instance, you can configure global tools, which are essential software packages or tools required to build, test, and deploy your applications. You can also manage plugins, which add functionality to Jenkins, and customize it as per your requirements.

In the Jenkins project, one can configure the following

  1. Description: This is useful in providing information about the project so that team members can get a full picture at a glance.

2. Builds Strategy: Build Strategy: In this step, you establish the retention period for builds and the maximum number of builds to maintain.

3. Build Triggers: Are the events that initiate the pipeline execution. Examples of build triggers include building after completing other projects, scheduling periodic builds (using a Cron job), using a GitHub webhook, etc.

4. Pipeline Script: This is a Groovy script that defines the tasks to be executed by the Jenkins Pipeline.

  • Declarative: This is a new way of creating a Jenkins Pipeline. Here, you define your Pipeline using a declarative syntax. The Pipeline is defined in a Jenkinsfile, which is checked into an SCM (Source Code Management).
  • Scripted: This is a way of writing Groovy code where you define your Pipeline using a Scripted syntax. The code is defined inside node blocks.

A Jenkins declarative pipeline

pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Hi, GeekFlare. Starting to build the App.'
}
}
stage('Test') {
steps {
input('Do you want to proceed?')
}
}
stage('Deploy') {
parallel {
stage('Deploy start ') {
steps {
echo "Start the deploy .."
}
}
stage('Deploying now') {
agent {
docker {
reuseNode true
image ‘nginx’
}
}

steps {
echo "Docker Created"
}
}
}
}
stage('Prod') {
steps {
echo "App is Prod Ready"
}

}
}
}

A Jenkins-scripted pipeline

node {
stage('Build'){

}
stage('Test'){

}
stage('Deploy'){

}
}

Although they perform the same task the declarative pipelines are easier to maintain and they tend to have a lower learning curve. For more information click here.

--

--

Lamai Anthony

Technical Engineer passionate about continuous learning and evolution. Always surfing the net and trying projects in search of new ideas and perspectives