我如何在Jenkins管道中使用管道脚本文件(“管道”选项卡)

时间:2020-02-25 11:02:44

标签: jenkins jenkins-pipeline

Jenkins的初学者。我已经在Linux服务器上设置了Jenkins并创建了管道。我在“管道”选项卡中看到,它在其中询问管道脚本或来自SCM的管道脚本。我没有使用任何SCM。我已经编写了示例管道脚本

 pipeline {
  agent {
       node {
          label ''
            }
        }

  stages {
     stage ('check script')
         {
           steps
              {
                 script
                    {
                      println " Checking the bounce scripts of application"
                     }   
            }
     }
     stage ('Bounce Application')
        {
          steps
             {
               script
                 {
                    println " Bouncing the application"
                }
            }
        }
       }
}

我想将上述管道脚本放在Jenkins服务器上的文件中,并在此处使用/调用它。我们有这个可行性吗?

谢谢您的帮助。

0 个答案:

没有答案