0

我正在使用声明性管道作为 Jenkins 工作。阶段“构建”和“归档”并行运行以从不同平台(linux 32 和 64、windows 等)的节点构建和收集工件

不幸的是,这些工件都是同名的。我无法mylib.so在单个管道作业中存档多个。或者我可以吗?

好吧,在 Windows 的情况下,库将是 a .dll,因此存在差异,但这不能成为解决此问题的整体解决方案。

有没有办法区分由多个节点构建的工件?

我的管道看起来类似于:

pipeline {
    agent none
    stages {
        stage('Build') {
            parallel {
                stage('Build on some Linux x64') {
                    agent { node { label 'linux_64' } }
                    steps {
                        // call make
                    }
                }
                stage('Build some more...') { ... }
            }
        }
        stage('Archive') {
            parallel {
                stage('Archive from Linux x64') {
                    agent { node { label 'linux_64' } }
                    steps {
                        archive includes: 'out/*.so'
                    }
                }
                stage('Archive some more...') { ... }
            }
        }
    }
}

我也看过这个,所以可能没有直接开箱即用的东西。

4

1 回答 1

0

About to face the same issue...

You can use the stash and unstash to move files between folders and nodes (Google unstashing into other directories). In which case stash your output for each platform, and add a final stage which unstashes each into separate folders. Then finally archive the lot to make it available after the build is complete.

There are variations on this, and of course you could have the build itself output to platform/architecture specific folders.

于 2017-12-14T17:16:19.147 回答