【问题标题】:Gitlab runner removes build folderGitlab runner 删除构建文件夹
【发布时间】:2021-02-22 12:34:35
【问题描述】:

在 12.6.0 版本的 gitlab-runner 上,我需要的 .Build 文件夹总是被删除。我在这里使用与此相同的设置: https://github.com/TYPO3-Documentation/tea/blob/main/.gitlab/pipeline/.gitlab-ci.yml

对他们来说,这些文件没有被删除,但对我来说总是如此。我需要用于 linting 的工件。

Checking out ffc908d4 as ci-cd...
Removing .Build/
Removing .composer/
Removing composer.lock

这就是正在发生的事情。我假设它与Reinitialized existing Git repository in ... 有关,因为提到的项目的所有者总是以某种方式拥有一个新的存储库。

我尝试使用dependencies 和needs。他们都没有工作。

我当前的 CI 配置:

stages:
  - build
  - lint

.default:
  image: php:7.4
  before_script:
    - bash .gitlab/build/docker_install.sh > /dev/null


build-composer-dependencies:
  extends: .default
  stage: build
  needs: [ ]
  variables:
    COMPOSER_CACHE_DIR: '.composer'
  script:
    - composer --version
    - COMPOSER_CACHE_DIR=.composer
      composer install --prefer-dist --no-progress --optimize-autoloader
  artifacts:
    when: on_success
    expire_in: 2 weeks
    paths:
      - .Build
  cache:
    paths:
      - .composer
      - .Build

json-lint:
  extends: .default
  stage: lint
  dependencies:
    - build-composer-dependencies
  script:
    - composer ci:json:lint

【问题讨论】:

    标签: continuous-integration gitlab


    【解决方案1】:

    我认为您仍然可以在工作json-lint 中使用.Build 目录下的工件。我使用 docker executor 类型的运行器,也使用从上游作业构建的工件。

    【讨论】:

      猜你喜欢
      • 2020-09-06
      • 2020-05-02
      • 1970-01-01
      • 2022-06-14
      • 2015-10-07
      • 2021-03-21
      • 2021-08-27
      • 2017-01-17
      • 2021-03-13
      相关资源
      最近更新 更多