1

我无法让 bitbucket 管道正确运行,它不断抛出权限被拒绝错误,我一辈子都看不出来为什么?

这是我的作曲家文件:

{
"name": "pswebsolutionsltd/psadoptables",
"description": "Framework for Building Adoptable Sites",
"version": "0.0.1",
"type": "project",
"homepage": "https://www.pswebsolutions.co.uk/",
"authors": [
    {
        "name": "Paul Cook",
        "email": "paul.cook@pswebsolutions.co.uk",
        "homepage": "https://www.pswebsolutions.co.uk/"
    }
],
"support": {
    "issues": "https://bitbucket.org/pswebsolutionsltd/psadoptables/issues?status=new&status=open",
    "wiki": "https://bitbucket.org/pswebsolutionsltd/psadoptables/wiki/",
    "source": "https://bitbucket.org/pswebsolutionsltd/psadoptables/src"
},
"scripts": {
    "test": [
        "@clean",
        "@load",
        "@clearCache",
        "@phpCS",
        "@phpUnit",
        "@phpDoc"
    ],
    "clean": "composer clear-cache",
    "load": "composer dump-autoload -o",
    "clearCache": "rm -rf cache && mkdir cache",
    "phpUnit": "phpunit --configuration phpunit.xml tests",
    "phpDoc": "phpdoc",
    "phpCS": "phpcs --config-set default_standard PSR2 phpcs src/ --extensions=php && phpcs tests/ --extensions=php",
    "phpCBF": "phpcbf ./ --extensions=php"
},
"autoload": {
    "psr-4": {
      "AdoptableFramework\\": "src/",
      "AdoptableFramework\\Tests\\": "tests/",
      "AdoptableFramework\\Extend\\": "src/extend/"
    }
},
"require": {
    "matthiasmullie/minify": "^1.3"
},
"require-dev": {
    "phpunit/phpunit": "5.7",
    "phpdocumentor/phpdocumentor": "2.*",
    "squizlabs/php_codesniffer": "3.*"
}

}

这是我的 bitbucket 管道配置文件:

P S Adoptable build configuration for PHP.

pipelines:
  default:
    - step:
        name: php56-mysql57
        image: php:5.6-apache
        script:
          # update apt
          - apt-get update && apt-get install -y unzip

          # install mysqli
          - apt-get install -y mysql-client
          - docker-php-ext-install mysqli

          # install and configure composer
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install --no-interaction --no-progress --prefer-dist
          - composer test
        services:
          - mysql57
definitions:
  services:
    mysql57:
      image: mysql:5.7
      environment:
        MYSQL_DATABASE: psadoptables
        MYSQL_ROOT_PASSWORD: root

输出是:

sh: 1: phpcs: Permission denied
Script phpcs --config-set default_standard PSR2 phpcs src/ --extensions=php && phpcs tests/ --extensions=php handling the phpCS event returned with error code 126

我缺少什么技巧吗?任何帮助将不胜感激!

4

1 回答 1

0

我会怀疑作曲家在 /usr/local/bin 或目录本身的权限。对于调试,您可以在安装 composer 之后立即在管道配置中添加“ls -l /usr/local/bin/composer”。

于 2017-12-14T10:16:42.837 回答