gpt4 book ai didi

linux - bitbucket 中的管道因 Composer 错误而失败

转载 作者:太空宇宙 更新时间:2023-11-04 12:04:04 25 4
gpt4 key购买 nike

我尝试在 bitbucket 中使用管道。这是我正在使用的默认配置:

# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:5.6.36
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- vendor/bin/phpunit

我收到这个错误

+ composer install
Do not run Composer as root/super user! See https://getcomposer.org/rootfor details
Composer could not find a composer.json file in /opt/atlassian/pipelines/agent/build
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

即使我在/opt/atlassian/pipelines/agent/build 中创建了 composer.json(以及所有路径)。

顺便说一句,为什么工具会在这样的路径中寻找 Composer ?我已经在/home/username/.composer 上安装了 composer

我做错了什么?

最佳答案

使用另一个 docker 容器代替 image: php:5.6.36 进行部署。有一个官方 Composer 容器:https://hub.docker.com/_/composer/它基于 php:7-alpine3.7,我希望 PHP7 也能在您的应用程序中完成这项工作。

关于linux - bitbucket 中的管道因 Composer 错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51284515/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com