我在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 / pipelinelines / agent / build中创建了composer.json(也是所有路径) .
顺便问一下,为什么工具在这样的路径中寻找作曲家呢?我在/home/username/.composer上安装了composer
我做错了什么?
1 回答
使用另一个docker容器进行部署而不是
image: php:5.6.36
. 有一个官方作曲家容器:https://hub.docker.com/_/composer/它基于php:7-alpine3.7
,我希望PHP7能够完成你的应用程序的工作 .