ibeautiful
2022-07-09 09:49:11
我在我的 bitbucket 管道中得到了這個:pipelines: branches: develop: - step: caches: - composer name: unit tests - Delivery image: totersapp/laravel-docker:phpredis script: - echo "memory_limit=512M" > /usr/local/etc/php/conf.d/memory-limit-php.ini - ln -f -s .env.pipelines .env - composer install services: - postgres - redis每次運行它都會下載相同的文件(即使是第二次運行)..任何想法為什么?這是作曲家安裝的日志:+ composer installLoading composer repositories with package informationInstalling dependencies (including require-dev) from lock filePackage operations: 199 installs, 0 updates, 0 removals - Installing kylekatarnls/update-helper (1.2.0): Downloading (connecting...)Downloading (0%) Downloading (100%) - Installing ocramius/package-versions (1.4.2): Downloading (connecting...)Downloading (0%) Downloading (30%)Downloading (35%)Downloading (65%)Downloading (95%)Downloading (100%) - Installing symfony/polyfill-ctype (v1.13.1): Downloading (connecting...)Downloading (0%) Downloading (100%)更新:無法覆蓋默認值基于這個答案,我嘗試了這個:- step: caches: - composer image: totersapp/laravel-docker:phpredis script: - composer install ..definitions:caches: composer: /composer/cache我的問題是我正在嘗試使用自定義緩存目錄(在本例中/composer/cache為在這個例子中,bitbucket 教程是用 bundle 做的: - bundle install --path vendor/bundle換句話說,我不能運行這樣的東西:- composer install --cache-directory /composer/cache
2 回答

手掌心
TA貢獻1942條經(jīng)驗 獲得超3個贊
根據(jù)Bitbucket 論壇上的一個問題,如果您使用的 docker 映像將下載的文件放在不尋常的位置,就會發(fā)生這種情況。根據(jù)有關緩存的文檔,通常緩存的目錄是~/.composer/cache,而圖像的 docker 文件使用/composer.
請嘗試使用以下配置。它包含一個自定義緩存(需要自定義名稱?。?,將自定義的 composer 文件夾放入緩存中:
pipelines:
branches:
develop:
- step:
caches:
- composer-custom
definitions:
caches:
composer-custom: /composer/cache
正如您在https://bitbucket.org/haasenico/composer-cache/addon/pipelines/home#!/results/4上看到的那樣,使用了緩存并且似乎適用于我的簡短示例
- 2 回答
- 0 關注
- 131 瀏覽
添加回答
舉報
0/150
提交
取消