简体   繁体   English

Jenkins 中的流水线和项目有什么区别?

[英]What is the difference between Pipeline and Project in Jenkins?

What is the difference between Pipeline and Project in Jenkins? Jenkins 中的流水线和项目有什么区别? Can I call a project from Pipeline.我可以从 Pipeline 调用一个项目吗? If Yes how using linux node?如果是,如何使用 linux 节点?

In Jenkins Projects are Jobs.在 Jenkins 中,项目就是工作。 Jobs can contain pipelines but they can also contain other workflows.作业可以包含管道,但也可以包含其他工作流。

Jenkins docs intro to pipeline Jenkins 文档介绍管道

Jenkins Pipeline is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins. Jenkins Pipeline是一套插件,支持在 Jenkins 中实现和集成持续交付管道。 Pipeline provides an extensible set of tools for modeling simple-to-complex delivery pipelines "as code" via the Pipeline DSL. Pipeline 提供了一组可扩展的工具,用于通过 Pipeline DSL 将简单到复杂的交付管道“作为代码”建模。 1 1

Jenkins Terminology詹金斯术语

Job/Project: Jenkins seems to use these terms interchangeably.工作/项目: Jenkins 似乎可以互换使用这些术语。 They all refer to runnable tasks that are controlled / monitored by Jenkins.它们都是指由 Jenkins 控制/监视的可运行任务。

Pipelines have a DSL (domain specific language) that only works within a Jenkins pipeline job.管道有一个 DSL(领域特定语言),它只能在 Jenkins 管道作业中工作。 Here is an example of how to run an existing Job / Project on a Linux node within a pipeline project.以下是如何在管道项目中的 Linux 节点上运行现有作业/项目的示例。

// specify your linux node by name
node('linux') {

    // run the project job named your-other-job
    stage('run project') {
        build 'your-other-job'
    }    

}

To dig deeper make sure to check out the helpful syntax generator built into Jenkins.要深入挖掘,请务必查看 Jenkins 内置的有用语法生成器。 在此处输入图片说明

And these pipeline examples这些管道示例

I suggest this helpfull link :我建议这个有用的链接:

from-freestyle-to-pipeline 从自由泳到流水线

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM