LANGUAGE/!$%!% ERROR NOTE 2017. 11. 22. 00:01

!markdown


# Gitlab (깃랩)


## Gitlab Runner (깃랩 러너)


.gitlab-ci.yml에 적은 내용대로 잘 실행해주면 좋겠는데... 


아규먼트(arguments), 인자가 무시되어버리는 현상을 발견했다.




### 1. Error (에러)


인자 값이 안들어간 것을 확인했다.


1차적으로 script: 에 적어 놓은 커맨드는 잘 되는데 


내가 만든 자바로된 어플리케이션을 거쳐서 인자와 함께 다른 쉘스크립트를 실행할때 인자를 잃어버린다.


어플리케이션의 문제가 있는 줄 알았는데, 내 로컬 터미널에서 사용할 때는 잘된다.


버그 같다. 


검색해봤더니 등록된 이슈가 있었다. 나의 사례도 살포시 적었다. ㅎㅎㅎ


[https://gitlab.com/gitlab-org/gitlab-runner/issues/2826#note_48036705](https://gitlab.com/gitlab-org/gitlab-runner/issues/2826#note_48036705)



 


### 2.. 환경

- GitLab Community Edition 10.1.3 e6142bc

- Running with gitlab-ci-multi-runner 9.4.2 (6d06f2e)


### 3. 발생 시점

1. (gitlab runner)이 (java application) 을 실행

2. (java application)이 (shell script file)을 실행

3. (shell script file)안에서 인자가 무시됨


### 4. 상세 

- .gitlab-ci.yml `(인자 통과됨)`

```yml

installer-maker:

  script:

    - installer-maker test -rsp=./installer-data/test-ci.rsp -mode.sql.progress.bar=false -log.level.console=debug

```


- java application(installer-maker) execute shell script(installer) like below `(인자 무시됨)`

```

sh -c /builds/gitlab/dg/metastream3/build/installer_myproject/bin/installer ask install -response.file.path=./installer-data/test-ci.rsp -mode.sql.progress.bar=false -log.level.console=debug -mode.exec.self=true

```


- shell script file(installer)

```

echo "$@"

```


쉘스크립트 파일에 위처럼 인자들이 포함되어 있는지 출력했을 때, 비어있는 것을 확인 할 수 있었다.


아래 인자들이 무시되었다.


`ask` `install` `-response.file.path=./installer-data/test-ci.rsp` `-mode.sql.progress.bar=false` `-log.level.console=debug` `-mode.exec.self=true`





### 5. Problem (문제)


버그?




### 6. Solved (해결)


우회해서 할 수 있는 방법이 있다면, 우선 우회하자.




### 7. Reference (참고)


- GitLab CI command argument of services are ignored: [https://gitlab.com/gitlab-org/gitlab-runner/issues/2826](https://gitlab.com/gitlab-org/gitlab-runner/issues/2826)