3

PHP プロジェクトをホストするために、Bitbucket にプライベート リポジトリをセットアップしました。このプロジェクトでは、パイプライン統合も使用します。

これは私のパイプライン yaml ファイルの内容です:

image: php:7.1.4

pipelines:
  default:
    - step:
        script:
          - ./install_xdebug.sh
          - ./install_mailhog.sh
          - ./install_composer.sh
          - composer install
          - vendor/bin/phpunit --coverage-clover=coverage.xml
          - if [ $? -eq 0 ]; then bash <(curl -s https://codecov.io/bash); fi

Xdebug でコード カバレッジ ファイルを生成できます。

Generating code coverage report in Clover XML format ... done

次の部分はこのファイルを codecov.io にアップロードしますが、この部分はエラーで失敗します

x> No CI provider detected.
    Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
    Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
    project root: .
/dev/fd/63: line 739: git: command not found
/dev/fd/63: line 739: hg: command not found
--> token set from env
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.xml bytes=81581
==> Appending adjustments
    http://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Uploading reports
    url: https://codecov.io
    query: branch=&commit=&build=&build_url=&name=&tag=&slug=&yaml=&service=&flags=&pr=&job=
    -> Pinging Codecov
HTTP 400
missing required properties: [&#39;commit&#39;]
4

1 に答える 1

3

エラーメッセージは少し不明瞭でした。本当の問題はgit、php 7.1.4 docker イメージに がインストールされていないことでした。apt-getパイプライン構成ファイルにコマンドを追加することでこれを解決しました。

apt-get インストール -y git

于 2017-07-27T14:08:34.703 に答える