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
• 290 points
167 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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
• 940 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
170 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
• 14,080 points
4,674 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,900 points
519 views
+13 votes
2 answers
0 votes
1 answer
+1 vote
1 answer

Is there a way to restrict permissions to a user per individual job in jenkins?

Yes, you can configure user permissions per ...READ MORE

answered May 28 in Jenkins by Sirajul
• 940 points

edited May 28 by Sirajul 34 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.