[英]Does gitlab-runner or Docker cache the /builds Directory by Default?
[英]Gitlab-runner change builds_dir
我在生產服務器上的默認 builds_dir 是/root/builds/qL8eZYTH/0/faramarzqoshchi/testing_gitlab_runner/
我希望它是/home/[domain_name]/public_html/test_build
這是我的測試階段。
我已經使用/home/[domain_name]/public_html/test_build
值在/etc/gitlab-runner/config.toml
定義了builds_dir變量,但它仍然沒有將testing_gitlab_runner
項目推送到/home/[domain_name]/public_html/test_build
。
我做的一切都正確嗎? 這是將測試和生產等不同階段推送到服務器的正確方法嗎?
操作系統:Centos
根據docs ,您還必須啟用custom_build_dir
設置,默認情況下僅對 docker 和 kubernetes 執行程序啟用:
[runners.custom_build_dir]
enabled = true
有關此設置的更多信息, 請參見此處。
您還應該嘗試設置變量$GIT_CLONE_PATH
:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/project-name
test:
script:
- pwd
GIT_CLONE_PATH 必須始終在 $CI_BUILDS_DIR 內。 $CI_BUILDS_DIR 中設置的目錄取決於 runners.builds_dir 設置的執行器和配置。
這只能在運行器的配置中啟用 custom_build_dir 時使用。 這是 docker 和 kubernetes 執行器的默認配置。
所以在你的具體情況下,我會在你的config.toml
嘗試這個:
builds_dir = "/home/[domain_name]/public_html/test_build"
[runners.custom_build_dir]
enabled = true
並將其添加到.gitlab-ci.yml
的頂部:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/testing_gitlab_runner
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.