簡體   English   中英

CircleCI“無法確保工作區目錄存在”

[英]CircleCI "Could not ensure that workspace directory exists"

我將CircleCIGameCI docker 圖像一起使用以構建 Unity 項目。 構建工作,但我試圖利用h-matsuo/github-release orb為了在 GitHub 上為構建創建一個版本。 我為此創建了一個新的單獨作業,因此我需要在作業之間共享數據。 如文檔中所述,我正在使用persist_to_workspace來執行此操作,但該解決方案似乎不起作用。 我收到以下錯誤:

無法確保工作空間目錄 /root/project/Zipped 存在

對於工作區持久化邏輯,我在config.yml文件中添加了以下代碼行:

  • working_directory: /root/project - 在主作業的執行者里面
  • persist_to_workspace - 作為我主要工作步驟中的最后一個命令
  • attach_workspace - 作為我第二份工作步驟中的一個開始命令

這是我的完整config.yml文件:

version: 2.1
orbs:
  github-release: h-matsuo/github-release@0.1.3

executors:
  unity_exec:
    docker:
      - image: unityci/editor:ubuntu-2019.4.19f1-windows-mono-0.9.0
    environment:
      BUILD_NAME: speedrun-circleci-build
    working_directory: /root/project

.build: &build
  executor: unity_exec
  steps:
    - checkout
    - run: mkdir -p /root/project/Zipped
    - run:
        name: Git submodule recursive
        command: git submodule update --init --recursive
    - run:
        name: Remove editor folder in shared project
        command: rm -rf ./Assets/Shared/Movement/Generic/Attributes/Editor/
    - run: 
        name: Converting Unity license
        command: chmod +x ./ci/unity_license.sh && ./ci/unity_license.sh
    - run:
        name: Building game binaries
        command: chmod +x ./ci/build.sh && ./ci/build.sh
    - run: 
        name: Zipping build
        command: apt update && apt -y install zip && zip -r "/root/project/Zipped/build.zip" ./Builds/
    - store_artifacts:
        path: /root/project/Zipped/build.zip
    - run:
        name: Show all files
        command: find "$(pwd)"
    - persist_to_workspace:
        root: Zipped
        paths:
            - build.zip
jobs:
  build_windows:
    <<: *build
    environment:
      BUILD_TARGET: StandaloneWindows64
  release:
    description: Build project and publish a new release tagged `v1.1.1`.
    executor: github-release/default
    steps:
      - attach_workspace:
          at: /root/project/Zipped
      - run:
          name: Show all files
          command: sudo find "/root/project"
      - github-release/create:
          tag: v1.1.1
          title: Version v1.1.1
          description: This release is version v1.1.1.
          file-path: ./build.zip
          
workflows:
  version: 2
  build:
    jobs:
      - build_windows
      - release:
          requires:
            - build_windows

有人可以幫我嗎?

如果有人遇到同樣的問題,請盡量避免使用/root路徑。 我已將工件存儲在/tmp/中的某個位置,在存儲工件之前,我使用帶有-m標志的mkdir手動創建了帶有chmod 777的文件夾來指定 chmod 權限。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM