如何使Concourse Linux机器读取可执行文件?(chmod样式)

如何使Concourse Linux机器读取可执行文件?(chmod样式),linux,bash,shell,continuous-integration,concourse,Linux,Bash,Shell,Continuous Integration,Concourse,我正在尝试让我的Concourse CI Linux虚拟机运行shell脚本。但我总是会遇到同样的错误: 我用chmod+x path/filename.sh在本地(非虚拟机,在Mac上)修复了这个问题,使其可执行并添加了#/bin/sh添加到shell脚本 但我不知道如何让Concourse/VM知道它是一个可执行文件?是否应该在task.sh中输入chmod命令?还是任务。yml?救命啊 我的广场CIpipeline.yml resources: - name: my-git-repo

我正在尝试让我的Concourse CI Linux虚拟机运行shell脚本。但我总是会遇到同样的错误:

我用
chmod+x path/filename.sh
在本地(非虚拟机,在Mac上)修复了这个问题,使其可执行并添加了
#/bin/sh
添加到shell脚本

但我不知道如何让Concourse/VM知道它是一个可执行文件?是否应该在task.sh中输入chmod命令?还是任务。yml?救命啊

我的广场CI
pipeline.yml

resources:
- name: my-git-repo
  type: git
  source:
    uri: git@github.com:org-name/my-git-repo.git
    branch: master
    private_key: {{git-private-key}}
- name: my-task
  type: git
  source:
    uri: git@gist.github.com:blahblahblah12345678910blah.git
    private_key: {{git-private-key}}

jobs:
- name: job-build-app
  plan:
  - get: my-git-repo
    trigger: true
  - get: task
  - task: run-build
    file: my-task/task.yml
我的
任务.yml

---
platform: linux

image_resource:
  type: docker-image
  source: {repository: busybox}

inputs:
- name: my-task

run:
  path: ./my-task/task.sh
我的
任务.sh

!#/bin/sh
echo this is my task shell script 
我希望这只是回显/注销上面的字符串


相反,我在顶部得到了500/权限拒绝错误。

git repo中的文件必须是
chmod+x
ed。在Gist中这样做会很困难,因为这不能在UI中设置

您可以克隆gist,
chmod+x
,然后重新推送,或者将您的任务改为运行
bash my task/task.sh
,这将不要求它是可执行的:

run:
  path: bash
  args: [./my-task/task.sh]

谢谢@alexsuraci是的,我最终修复了它,克隆了gist,在本地添加了一个新文件,chmod'ing它,然后推送它。您还可以使用
git update index--chmod=+x task.sh
更改
chmod
状态,或者根据需要自动执行。