如何从另一个资源的目录执行Concourse任务脚本?

时间:2019-09-08 21:33:15

标签: concourse concourse-task

具有此任务配置:

config:
  platform: linux
  inputs:
    - name: resource_to_run_in
    - name: resource_with_scripts
  run:
    path: resource_with_scripts/script.sh
    dir: resource_to_run_in

我收到以下错误:

Backend error: Exit status: 500, message: {"Type":"ExecutableNotFoundError","Message":"exec failed: container_linux.go:344: starting container process caused \"exec: \\\"resource_with_scripts/script.sh\\\": stat resource_with_scripts/script.sh: no such file or directory\"\n","Handle":"","ProcessID":"","Binary":""}

我希望Concourse在资源script.sh的目录中运行resource_to_run_in的绝对路径。

我该如何实现?

1 个答案:

答案 0 :(得分:0)

我发现的唯一方法是使用点导航:

config:
  platform: linux
  inputs:
    - name: resource_to_run_in
    - name: resource_with_scripts
  run:
    path: ../resource_with_scripts/script.sh
    dir: resource_to_run_in

通过这种方式,我仍然希望Concourse在运行时将这些资源名称解析为绝对路径(不向用户显示)