我有一個gitlab亞軍相關圖片如下:如何從ci-pipeline執行位於跑步者的腳本?
Dockerfile
FROM alpine:3.6
RUN apk add --no-cache curl bash
COPY trigger-jenkins /usr/local/bin/trigger-jenkins
ENTRYPOINT ["/bin/bash"]
其目的是觸發詹金斯工作。運行此:
docker run -ti jenkins-runner:latest trigger-jenkins jon_name
工作得很好。但是,當我試圖做同樣的:
.gitlab-ci.yml
Jenkins Trigger:
script:
- trigger-jenkins job_name
tags:
- Jenkins
管道失敗是這樣的:
Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
on Jenkins Trigger (12475d61)
Using Docker executor with image jenkins-runner:latest ...
Using docker image sha256:44dedf0b3485e0e57107e2745739e1a252fb64c4161465e1b5ccc1119a1183bf for predefined container...
Using docker image jenkins-runner:latest ID=sha256:4760a8ef9139ee9c9a56c686de780fc49e176fe4294e1f0db4f431e117b6811c for build container...
Running on runner-12475d61-project-6-concurrent-0 via cc960a3794a0...
Cloning repository...
Cloning into '/builds/dev/Project'...
Checking out 874b2eac as test/jenkins...
Skipping Git submodules setup
/bin/sh: /bin/sh: cannot execute binary file
/bin/sh: /bin/sh: cannot execute binary file
ERROR: Job failed: exit code 126
我搜索了錯誤代碼,但無法找到解釋。
我錯過了什麼?
您還沒有在yaml中指定圖片? –
我已經註冊了標籤爲'Jenkins'的跑步者。正如您在日誌中看到的那樣,加載了正確的圖像。 –
該文件是可執行文件或shell腳本? –