這是我的 gitlab-ci.yml 檔案
stages:
- build_dev
build_dev:
stage: build_dev
only:
refs:
- master
tags:
- Fluffa-fe
script:
- pwd
- ls -lah
- cd /var/www/html/fluffa.company/fe
- git pull
- CI=false && npm install && npm run build
- chown -R www-data:www-data /var/www/html/
我的作業失敗了
$ cd /var/www/html/fluffa.company/fe
bash: line 116: cd: /var/www/html/fluffa.company/fe: No such file or directory
ERROR: Job failed: exit status 1
為什么?似乎找不到容器路徑?我檢查了我的服務器 Docker 容器掛載點
"Mounts": [
{
"Type": "bind",
"Source": "/webfolder/docker-lab/dev/dev_fluffa/fe/ssh",
"Destination": "/root/.ssh",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/webfolder/fluffa.company",
"Destination": "/var/www/html/fluffa.company",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
如何解決這個問題?
uj5u.com熱心網友回復:
假設管道在您的 Docker 容器中執行,請將ls -alrth /var/www/html/fluffa.company命令添加到您的script.
這將允許您檢查:
- 如果父檔案夾存在
- 如果與它(或其子檔案夾
fe)相關的權限允許 gitlab-ci 腳本訪問它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/480090.html
