【问题标题】:what is Jenkins file and how you will write什么是 Jenkins 文件以及您将如何编写
【发布时间】:2018-08-29 01:34:17
【问题描述】:

什么是 Jenkins 文件以及我们将如何编写?

如何使用 DSL 动态创建 Jenkins 作业(我不知道 DSL)

【问题讨论】:

    标签: testing jenkins deployment build jenkins-plugins


    【解决方案1】:

    来自Jenkins User Handbook 的第 30 页:`Jenkinsfile 是一个文本文件,其中包含 Jenkins 流水线的定义并被检入源代码控制。在他的章节中,您可以找到管道示例。

    // Declarative //
    pipeline {
        agent any
        stages {
        stage('Build') {
            steps {
                echo 'Building..'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
          }
        }
        stage('Deploy') {
            steps {
                 echo 'Deploying....'
            }
         }
    }
    
    
    // Script //
    node {
      stage('Build') {
           echo 'Building....'
      }
      stage('Test') {
          echo 'Building....'
      }
      stage('Deploy') {
          echo 'Deploying....'
      }
    }
    

    【讨论】:

    • 请你解释一下我是新手的一些基本知识
    • 请澄清你的意思。
    猜你喜欢
    • 1970-01-01
    • 2011-10-20
    • 2013-01-16
    • 2015-02-19
    • 2011-10-21
    • 2012-05-30
    • 2013-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多