# What is the most preferred pipeline in other companies, Declarative or Scripted?

Pipeline

##### Post Metadata
- Posted at: almost 7 years ago
- Author title: Sr Engineer
- Net upvotes: 1


## Comments
### Comment 1

The type of pipeline a company or individual uses  will depend on what they are asking the pipeline to do.   There are simply some functions that a declarative pipeline can not perform.  

Personally though,  I do not write scripted pipelines as my pipelines are fairly simple in nature. 

Your best bet is to learn the pipeline style that meets your needs. 

##### Comment Metadata
- Posted at: over 6 years ago
- Author title: Senior Web Administrator



### Comment 2

Mostly Declarative pipeline since t 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. scripted pipeline uses stricter groovy based syntaxes. 

The declarative pipeline is defined within a block labelled ‘pipeline’ whereas the scripted pipeline is defined within a ‘node’. 

The Declarative pipeline code will looks like this:

pipeline {
    agent none 
    stages {
        stage(&#39;Example Build&#39;) {
            agent { docker &#39;maven:3-alpine&#39; } 
            steps {
                echo &#39;Hello, Maven&#39;
                sh &#39;mvn --version&#39;
            }
        }
        stage(&#39;Example Test&#39;) {
            agent { docker &#39;openjdk:8-jre&#39; } 
            steps {
                echo &#39;Hello, JDK&#39;
                sh &#39;java -version&#39;
            }
        }
    }
}

This also promotes the idea of a &quot;Shared Libraries&quot; pipeline: https://jenkins.io/doc/book/pipeline/shared-libraries/

##### Comment Metadata
- Posted at: over 6 years ago
- Author title: Development Lead




## Related Product
[CloudBees Jenkins Support](https://www.g2.com/products/cloudbees-jenkins-support/reviews)

## Related Category
[Continuous Integration](https://www.g2.com/categories/continuous-integration)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


