Blog

Sample Jenkins file

Here’s sample declarative type of Jenkinsfile for reference

  • It has 2 stages
  1. Build
  2. Deploy
  • It echo statements in both stages
  • It can run on any agent in stand-alone or cluster mode
pipeline {
    agent any
    stages {

        stage("Build")
        {
            steps
            {
                script {
                        echo "INFO: Build Stage"
                    }
            }
        }

        stage("Deploy")
        {
            steps
            {
                script {
                            echo "INFO: Deploy Stage"
                    }
            }
        }
    }
}

To know more, on how to create multi-stage Jenkins pipeline and deploy Jenkinsfile, watch this video

Drafted On,
22nd January 2022
DevOps @identicalCloud.com