停止gitlab runner以不删除目录

停止gitlab runner以不删除目录,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我有一个在构建期间生成的目录,在下一个构建中不应该删除它。我试图在.gitlab-ci.yml中使用缓存保留目录: cache: key: "$CI_BUILD_REF_NAME" untracked: true paths: - target_directory/ build-runner1: stage: build script: - ./build-platform.sh target_directory 在第一个构建中生成cache.zip,但在下

我有一个在构建期间生成的目录,在下一个构建中不应该删除它。我试图在.gitlab-ci.yml中使用缓存保留目录:

cache:
  key: "$CI_BUILD_REF_NAME"
  untracked: true
  paths:
    - target_directory/
build-runner1:
  stage: build
  script:
    - ./build-platform.sh target_directory
在第一个构建中生成cache.zip,但在下一个构建中,删除目标目录并提取cache.zip,这需要很长时间。以下是第二次生成的日志:

Running with gitlab-ci-multi-runner 1.11.
  on Runner1
Using Shell executor...
Running on Runner1...
Fetching changes...
Removing target_directory/
HEAD is now at xxxxx Update .gitlab-ci.yml
From xxxx
Checking out xxx as master...
Skipping Git submodules setup
Checking cache for master...
Successfully extracted cache

有没有办法让gitlab runner一开始就不删除目录?

您需要的是使用作业工件:

Artifacts是一个文件和目录列表,这些文件和目录附加到 作业成功完成后再执行

.gitlab ci.yml
文件:

your job:
    before_script:
        - do something
    script:
         - do another thing
         - do something to generate your zip file (example: myFiles.zip)
  artifacts:
    paths:
         - myFiles.zip
作业完成后,如果您访问作业的特定页面,您可以看到有一个用于下载工件存档的按钮

  • 如果需要在不同作业之间传递工件,则需要使用依赖项
  • 如果您真的有这种需要,Gitlab有一个很好的文档

对我不起作用。既不依赖也不需要。runner的版本是12.6