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...

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.