2016-08-25 69 views
0

亞軍已經啓動泊塢窗容器中,config.toml是:Gitlab-CI多選手開始搬運工容器,腳本現在的工作

concurrent = 1 
check_interval = 0 

[[runners]] 
    name = "spring-boot-scripts" 
    url = "http://xxxxx.com/ci" 
    token = "xxxxxx" 
    executor = "docker" 
    builds_dir = "/tmp/builds" 
    [runners.docker] 
    tls_verify = false 
    image = "spring-boot-demo:ci" 
    privileged = false 
    disable_cache = true 
    volumes = ["/cache"] 
    [runners.cache] 
    Insecure = false 

.gitlab-ci.yml是:這樣的

image: spring-boot-demo:ci 
stages: 
    - build 

before_scipts: 
    - mkdir /tmp/before_scripts 
    - echo "============before_scripts=========" 

job1: 
    stage: build 
    script: 
    - sh /home/admin/spring-boot-demo-application/bin/entrypoint.sh 

after_scipts: 
    - mkdir /tmp/after_scripts 
    - echo "============after_scripts=========" 

gitlab的輸出,以及建築任務不能停止,直到取消:

Running with gitlab-ci-multi-runner 1.4.2 (bcc1794) 
Using Docker executor with image spring-boot-demo:ci ... 
Pulling docker image spring-boot-demo:ci ... 
WARNING: Cannot pull the latest version of image spring-boot-demo:ci : Error: image library/spring-boot-demo:ci not found 
WARNING: Locally found image will be used instead. 
Running on runner-278e2660-project-114610-concurrent-0 via 6ca6af37d681... 
Cloning repository... 
Cloning into '/tmp/builds/spring-boot/startup-scripts'... 
Checking out b58711bc as debug... 

現在的問題tions是: 如果before_scripts/script/after_scripts在容器中執行exec,爲什麼我找不到目錄/ tmp/before_scripts,/ tmp/after_scripts和作業的腳本在容器中不起作用

+0

1.腳本在容器中運行。 2.你需要更具體地瞭解你期望看到什麼和沒有工作。 Gitlab顯示了構建作業的輸出,因此您通常可以清楚地看到發生了什麼。 – Matthew

+0

謝謝你的回覆。如果此腳本在容器內運行,爲什麼我不能在容器中找到目錄/ tmp/before_scripts,並且entrypoint.sh不是exec。 – eliot

+0

這樣的構建任務結果:'使用gitlab-ci-multi-runner 1.4.2(bcc1794)運行 使用Docker執行程序與圖像spring-boot-demo:ci ... Pulling docker image spring-boot-demo: ci ... 警告:無法拉出最新版本的圖像spring-boot-demo:ci:錯誤:image library/spring-boot-demo:ci未找到 警告:將使用本地找到的圖像。 在runner-278e2660-project-114610-concurrent-0上運行通過6ca6af37d681 ... 克隆存儲庫... 克隆到'/ tmp/builds/spring-boot/startup-scripts'中... 檢出b58711bc爲調試...' – eliot

回答

0

您找不到因爲作業沒有運行。您在before_script和after_script作業中拼錯了「腳本」。另外,請注意,正確的工作不是複數,最終沒有's'。

GitLab docs