简体   繁体   English

CircleCI“无法确保工作区目录存在”

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

I am using CircleCI with a GameCI docker image in order to build a Unity project.我将CircleCIGameCI docker 图像一起使用以构建 Unity 项目。 The build works, but I am trying to make use of theh-matsuo/github-release orb in order to create a release on GitHub for the build.构建工作,但我试图利用h-matsuo/github-release orb为了在 GitHub 上为构建创建一个版本。 I have created a new separate job for this, so I needed to share data between the jobs.我为此创建了一个新的单独作业,因此我需要在作业之间共享数据。 I am using persist_to_workspace in order to do that, as specified in the documentation, but the solution doesn't seem to work.如文档中所述,我正在使用persist_to_workspace来执行此操作,但该解决方案似乎不起作用。 I get the following error:我收到以下错误:

Could not ensure that workspace directory /root/project/Zipped exists无法确保工作空间目录 /root/project/Zipped 存在

For the workspace persist logic, I've added the following lines of code in my config.yml file:对于工作区持久化逻辑,我在config.yml文件中添加了以下代码行:

  • working_directory: /root/project - Inside the executor of the main job working_directory: /root/project - 在主作业的执行者里面
  • persist_to_workspace - As a last command inside my main job's steps persist_to_workspace - 作为我主要工作步骤中的最后一个命令
  • attach_workspace - As a beginning command inside my second job's steps attach_workspace - 作为我第二份工作步骤中的一个开始命令

Here's my full config.yml file:这是我的完整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

Can somebody help me with this please?有人可以帮我吗?

If somebody ever encounters the same issue, try to avoid making use of the /root path.如果有人遇到同样的问题,请尽量避免使用/root路径。 I've stored the artifacts somewhere inside /tmp/ , and before storing artifacts, I've manually created the folder with chmod 777 by using mkdir with the -m flag to specify chmod permissions.我已将工件存储在/tmp/中的某个位置,在存储工件之前,我使用带有-m标志的mkdir手动创建了带有chmod 777的文件夹来指定 chmod 权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 unity 确保读/写已启用 - unity Ensure Read/Write is enabled 如何确保在Photon Unity中成功发送RPC? - How to ensure RPC was sent successfully in Photon Unity? 存在的方法没有方法异常 - No Method Exception on a method that exists unity cloud build bash脚本修改文件,使用$WORKSPACE变量 - Unity cloud build bash script to modify files, using the $WORKSPACE variable Unity-确保仅一个实例执行给定命令 - Unity - ensure that only one instance does the given command 如何确保对象不会彼此重叠(随机生成的位置) - How to ensure objects are not spawned on top of one another (random spawn location) 在Unity 3D编辑器中复制时,如何确保ScriptableObject是唯一的? - How to ensure ScriptableObjects are unique when copied in the Unity 3D editor? 有没有一种方法可以确保一个对象始终显示在另一个对象的上方而没有重叠? - Is there a way to ensure that an object is always displayed on top of another with no overlaps? 如何确保 ChildAdded 事件侦听器中子项的有序处理? - How to ensure ordered processing of children in ChildAdded event listener? 确保旋转花费相同的时间,无论在 Unity 中旋转的角度如何 - Ensure rotation takes the same amount of time regardless of angle to be rotated in Unity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM