1

我有一个多环境构建:我在 mac、linux 和 windows 上构建的 Qt 应用程序。到目前为止,我正在使用“多配置项目”来构建我的 3 个奴隶并在主詹金斯上拥有 3 个工件。

现在我想对 Jenkinsfile 做同样的事情。我该如何进行?

这是我做的实验(不是我的真实项目,但它是一个简化的示例)

stage 'clone'
node {
     git url: 'https://github.com/Foo/test.git'
     stash "source"
}

stage 'build'
parallel "random-string-1": {
    node("linux") {
      unstash "source"
      sh "./build.sh linux"
      echo "it was linux"
      stash "arch"
    }
}, "random-string-2": {
    node("mac") {
      unstash "source"
      sh "./build.sh mac"
      echo "it was mac"
      stash "arch"
    }
}

stage 'archive'
node {
     unstash "arch"
     archive "test"
}

当我这样做时,我的主人只有一件神器。

知道我应该使用的语法吗?

4

0 回答 0