What is the use of using declarative pipeline (i.e jenkins file) over scripted pipeline in real time

0 votes
Please provide major use cases between the mentioned two pipelines.
Oct 28 in Jenkins by Shashi
• 320 points
82 views

1 answer to this question.

0 votes

Hi@Shashi,

The declarative pipeline is a relatively new feature that supports the pipeline as a code concept. It makes the pipeline code easier to read and write. This code is written in a Jenkinsfile which can be checked into a source control management system such as Git. Whereas, the scripted pipeline is a traditional way of writing the code.

You can also go through the below link.

https://www.edureka.co/community/54705/difference-between-declarative-pipeline-scripted-pipeliine

answered Oct 28 by MD
• 77,580 points
Interviewer is not satisfied with above answer. Cross question as below

Can we call the scripted pipeline through jenkins keeping it outside of jenkins using any functions, is it possible ?

Hi@Shashi,

I guess you can do that. You can create your scripted pipeline Job and then you can call or trigger the scripted pipeline using any function. This is how we create one pipeline Job using Groovy language.

Related Questions In Jenkins

0 votes
2 answers
0 votes
2 answers
0 votes
1 answer

Can I use multiple containers on a jenkins declarative pipeline?

Yes of course you can!! You try ...READ MORE

answered Apr 12, 2019 in Jenkins by Vedant
2,471 views
0 votes
2 answers

What is the command to restart jenkins through command line in linux?

On Ubuntu or Debian, when installed through apt-get/dpkg: $ ...READ MORE

answered Aug 1, 2019 in Jenkins by Sirajul
• 58,210 points
8,753 views
0 votes
1 answer

What is "Pipeline as code" concept in jenkins?

Jenkins "Pipeline as code"  allows you to define ...READ MORE

answered Jun 4, 2019 in Jenkins by Sirajul
• 58,210 points
773 views
0 votes
1 answer
0 votes
1 answer

What is the difference between the Jenkins jobs which are in workspace directory and jobs directory

Hi@Shashi, These folders have different meanings in Jenkins. If ...READ MORE

answered Oct 21 in Jenkins by MD
• 77,580 points
41 views