【发布时间】:2018-12-19 10:30:34
【问题描述】:
我尝试使用 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(也包括所有路径)。
顺便说一句,为什么工具在这样的路径中寻找作曲家?我已经在 /home/username/.composer 上安装了 composer
我做错了什么?
【问题讨论】:
-
请改写帖子。为什么工具在做什么?你在 /home/username/.composer 中安装了什么?为什么不使用安装了 composer 的docker image?为什么不在运行 composer install 之前在该路径中创建 composer.json 并查看错误是否仍然存在?
-
对不起,我的英语不好,我填了几句。
-
我手动安装了作曲家,它可以工作。当我将作曲家写到终端时,它会完成所有必须做的事情。在路径 /home/username/.composer 中是 composer.json。我不知道为什么 bitbucket 不使用该作曲家并尝试在 /opt/atlassian/pipelines/agent/build 中查找 composer.json。没有作曲家,我手动创建了那个文件,但没有帮助。
-
您的 PC 上安装了 composer 吗?你知道 bitbucked 管道是在 docker 环境中执行的吗?
标签: linux composer-php bitbucket bitbucket-pipelines