Is it possible to create a jenkins pipeline without using a jenkinsfile?

+1 vote
How can I create a simple jenkins pipeline without having to write the jenkinsfile or use the concept of pipeline as code?
May 31 in Jenkins by Sam
• 2,140 points
273 views

1 answer to this question.

+1 vote
Best answer

Yes, you can create a Jenkins pipeline manually without having to write the script/code in the Jenkinsfile.

Suppose I have to create a pipeline comprising of  3  jobs namely:

Job 1 : Compile  

Job 2 : Test  

Job 3 : Package

Create the jobs. 

Here I have created 3 jobs as specified above which use Git repository for the source code and maven (invoking top level maven targets and specifying the goal as compile)

After Creating all the 3 jobs the next step we have to do is to connect them in the form of a pipeline. In order to do this we need to configure two things: Build Triggers and Post Build Actions

Go to Configure tab of the compile job -> Build Trigger ->Select "Build after other projects are built"->Specify the job that should trigger it.

Since I want to manually build the compile job, I am not specifying a build trigger for the compile job.

Next Go to "Post build Actions" ->Select "Build other projects" -> Specify the job that you want to trigger next. In this case,I want Test to run after compile. Hence I specify Test job as shown below :

Similarly I configure Test job : Build Trigger in this case would be compile and Post build action would be to build Package job as shown below

Same for Package job: Build Trigger would be Test and since this is the last job in the pipeline there is no Post build action for this job.

Now for the pipeline view you will need to install "Build Pipeline plugin". 

Go to Manage Jenkins -> Manage Plugins -> Available tab -> search for Build Pipeline plugin->Install it.

Once the plugin is installed Go to Jenkins Dashboard -> click on + on top of the list of jobs -> click on build pipeline view.

Enter the view name and also the initial job and the number of builds as shown:

You will be able to see the pipeline built successfully and when you build the first job the pipeline would start as shown:

Compile job will automatically trigger Test job after its execution which on completion will trigger Package job  as shown below:

On Complete Execution the pipeline would look like:

answered May 31 by Sirajul
• 29,740 points

selected May 31 by Kalgi

Related Questions In Jenkins

+1 vote
3 answers
+1 vote
5 answers

Is it possible to shift or move jobs between two jenkins servers?

There are some Jenkins plugins out there ...READ MORE

answered Oct 25, 2018 in Jenkins by akaash
1,706 views
+4 votes
7 answers

How to set the pipeline name and description for a Jenkinsfile?

You can rename pipeline jobs in jenkins ...READ MORE

answered Oct 11, 2018 in Jenkins by Hannah
• 15,220 points
7,449 views
0 votes
2 answers

Is possible for Jenkins to auto start and stop slave nodes?

Try Jenkins Plugin called as Slave SetupPlugin. This ...READ MORE

answered Aug 6, 2018 in Jenkins by Nilesh
• 6,880 points
941 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
177 views
0 votes
1 answer
0 votes
2 answers

How to trigger a Jenkins pipeline A in another Jenkins pipeline B?

If you are talking about executing another ...READ MORE

answered Jul 31 in Jenkins by Sirajul
• 29,740 points
5,301 views