简体   繁体   English

Bitbucket中的管道因作曲家错误而失败

[英]Pipeline in bitbucket failed by composer error

I try pipeline in bitbucket. 我尝试在bitbucket中使用管道。 This is default conf which I am using: 这是我正在使用的默认配置:

# 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

I am getting this error 我收到此错误

+ 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

Even when I created composer.json (all path as well) in /opt/atlassian/pipelines/agent/build. 即使我在/ opt / atlassian / pipelines / agent / build中创建了composer.json(以及所有路径)。

Btw, why tool looking for composer in such path? 顺便说一句,为什么工具会在这样的道路上寻找作曲家? I have installed composer on /home/username/.composer 我已经在/home/username/.composer上安装了composer

What did I do wrong? 我做错了什么?

Use another docker container for deployment instead of image: php:5.6.36 . 使用另一个docker容器而不是image: php:5.6.36进行部署image: php:5.6.36 There is an official composer container: https://hub.docker.com/_/composer/ It's based on php:7-alpine3.7 , I hope PHP7 does the job with your application too. 有一个官方的作曲家容器: https php:7-alpine3.7它基于php:7-alpine3.7 ,我希望PHP7也能对您的应用程序起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM