2017-12-05 27 views
1

쉘 스크립트를 실행하기 위해 Concourse CI Linux VM을 얻으려고합니다. 하지만 난 같은 오류가 점점 계속 : Concourse Linux Machine은 어떻게 실행 파일을 읽게 만드나요? (chmod 스타일)

enter image description here

내가 그것을 실행하고 쉘 스크립트에 !#/bin/sh를 추가 할 chmod +x path/filename.sh이 로컬 (Mac의 비 VM) 고정.

하지만 Concourse/VM에 실행 파일임을 알리는 방법을 모르겠습니다. task.sh에 넣어야하는 chmod 명령이 있습니까? 또는 task.yml? 도움!

내 콩 코스 CI pipeline.yml

resources: 
- name: my-git-repo 
    type: git 
    source: 
    uri: [email protected]:org-name/my-git-repo.git 
    branch: master 
    private_key: {{git-private-key}} 
- name: my-task 
    type: git 
    source: 
    uri: [email protected]: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 

task.yml : 내 task.sh

--- 
platform: linux 

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

inputs: 
- name: my-task 

run: 
    path: ./my-task/task.sh 

: 내가 기대

!#/bin/sh 
echo this is my task shell script 

이 단지/위의 문자열을 로그 아웃 에코.

대신 상단에 500/permission denied 오류가 표시됩니다.

답변

3

자식 repo의 파일은 chmod +x이어야합니다. UI에서 설정할 수 없으므로 Gist에서 그렇게하는 것은 어려울 것입니다.

당신은 요점, chmod +x를 복제, 다시 밀어하거나 실행할 수 있도록 요구하지 않을 것이다하는 대신 bash my-task/task.sh을 실행하도록 작업을 변경할 수 있습니다 :

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

감사 @alexsuraci 그래 내가 고정 결국 요점을 복제하고 로컬에 새 파일을 추가 한 다음 chmod'ing 한 다음 밀어 넣으십시오. 곧바로 일했다. – Aid

+0

'chmod' 상태를 바꾸기 위해'git update-index --chmod = + x task.sh' 명령을 사용하거나 [이 해설에 설명 된대로] 자동화 할 수도 있습니다 (https://stackoverflow.com/q/14267441)./1262901). –