1

我正在尝试为我的项目使用 bitbucket 管道,并且我使用简单的配置:

image: phpunit/phpunit:5.0.3

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - composer --version
          - phpunit --version
          - composer global require "fxp/composer-asset-plugin:^1.2.0"
          - composer install
          - php init --env=Development --overwrite=All

但是,在作曲家安装阶段,我需要一个 github 令牌,因为 yii2 在 github 上。那么,如何使用这个配置运行带有令牌的作曲家?

4

1 回答 1

1

为 Composer 设置一些配置就足够了。使用什么命令的链接:API 速率限制和 OAuth 令牌。简单的步骤:

  1. 在 Github 上创建一个帐户。你会得到类似acd276d00a9de5a15743b7a0a33e39c0e7b8aed8的东西。请务必记下,因为一段时间后您将无法查看它。

  2. 使用 Composer 终端(例如 Git)并输入命令:

    composer config -g github-oauth.github.com <oauthtoken>

<oauthtoken>你的令牌在哪里。

现在应该配置它,并且 Composer 现在应该允许您安装。

于 2016-10-25T14:58:06.860 回答