Jenkinfile DSL how to specify target directory

后端 未结 5 1086
予麋鹿
予麋鹿 2021-02-18 14:17

I\'m exploring Jenkins 2.0 pipelines. So far my file is pretty simple.

node {
    stage \"checkout\"
    git([url:\"https://github.com/luxengine/math.git\"])

           


        
5条回答
  •  [愿得一人]
    2021-02-18 14:48

        pipeline {
    
          agent any
          stages{
            stage("Checkout") {
                steps {
                        dir('def exists = fileNotExists \'git\'') {
                          bat label: '', script: 'sh "mkdir.sh'
                        }
                        dir ('cm') {
                            git branch: 'dev',
                            credentialsId: '',
                            url: ''
                        }
                    }
                } //End of Checkout stage
            stage("TestShellScript") {
                steps {
                    bat label: '', script: 'sh "PrintNumber.sh"'
                }
              }
            }//End of stages
        } // End of pipeline
    
    
    Note: cat mkdir.sh
    #!/bin/bash
    #Create a directory
    mkdir git
    

提交回复
热议问题