首页 > 解决方案 > Google Cloud Build Artifact 命令异常

问题描述

我的目标是使用 google cloud build 执行 python 脚本,然后将两个工件上传到注册表。当我使用这个 yaml 时,我可以在 /home/jovyan 中看到权限为 777 的两个输出文件,但是当我用工件路径指向它们时,我得到一个错误CommandException: No URLs match

timeout: 9001s #2.5 hour time-out
options:
  machineType: 'UNSPECIFIED' # 'N1_HIGHCPU_8' # 'E2_HIGHCPU_32'
steps:

# spin up a docker container to do the scoreboard generation
- name: 'jupyter/scipy-notebook:notebook-6.4.4'
  entrypoint: 'bash'
  env:
  - 'DOCKER=1'
  args:
  - -c
  - |
    pwd
    whoami
    ls -la /home/jovyan
    ls -la
    python3 scoreboard.py $(git diff --name-only HEAD HEAD~1)
    chmod 777 /home/jovyan/data_out.json
    chmod 777 /home/jovyan/scoreboard_out.md
    ls -la /home/jovyan

# save output json file to cloud storage
artifacts:
  objects:
    location: gs://gops-results/
    paths:
      - /home/jovyan/data_out.json
      - /home/jovyan/scoreboard_out.md

标签: google-cloud-build

解决方案


推荐阅读