0

On creation of a new job(as free style project), and running it, I see that Jenkinsfile is generated in job's workspace, after running the job.

But I see that all the pipeline code is commented. This is declarative syntax pipeline code.

So, apart from scriptlet generator option,

1) Does Jenkins(by default) create Jenkinsfile with DSL syntax in its workspace? For its job...

2) If yes, Can Jenkins generate scripted pipeline in it's workspace? Groovy syntax...

overexchange
  • 189
  • 1
  • 10

1 Answers1

1

No, Jenkins file is not created at execution. Actually Jenkins file is a suite of all steps or activity which you want to build as a job or a groovy code.

Jenkins file come from code repository, if you added file in your project.

Below is a Jenkins file example:

pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                echo 'Building..'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}

for more reference watch this video: https://www.youtube.com/watch?v=KZY4Rwsewro

Jay
  • 1,064
  • 2
  • 12
  • 21
Subhash
  • 1,586
  • 11
  • 18