1

我想在我的 gitlab-ci scrypt 中的作业之间(在其他阶段)传递一些变量。我用的例子:

buildTest:
    stage: build
    artifacts:
        reports:
            dotenv: build.env
        name: "FullRelease"
        paths:
            - 'app'
        expire_in: 1 day
    script: |
        echo "version=1.2.3" >> build.env
....
runWin:
    stage: runOnWin
    variables:
        GIT_STRATEGY: none
    script: |
        echo "Version is %version%"
    needs:
        - job: buildTest
          artifacts: true

一切正常,但我从“buildTest”(整个文件夹应用程序,很大)中获得了所有工件。这有点奇怪,但它不包含文件'build.env',这只是我需要的。有没有可能只传递变量,而不传递其他工件。如果我设置 artifacts: false - 不传递任何变量。

4

0 回答 0