首页 文章

Heroku PHP与bitbucket-pipelines.yml - 找不到git命令

提问于
浏览
0

我花了几个小时才发现这个thread,但解决方案并没有帮助我 .

我的设置

  • Laravel PHP信息应用程序与phpinfo视图,没有额外的

  • Bitbucket Cloud与Heroku管道

  • Heroku app相应配置

The problem is ,当我将更改推送到Bitbucket时,这些是 then pushed to Herokugit command is not found .

请参阅我的 bitbucket-pipelines.yml 链接到pastebin .

当管道步骤“Deploy to Heroku”运行时,它会中止说

+ git push 
https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD

bash: git: command not found

在构建设置中,git的安装成功完成 . 见screenshot .

为什么git命令失败了?

提前致谢!

1 回答

  • 0

    失败的原因是,在第二步中没有安装git组件 .

    请在下面找到更正的版本 .

    # 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:7.1.3
    
    pipelines:
    default:
    - step:
      name: Set up the docker container
      caches:
    - composer
      script:
      - apt-get update && apt-get install -y unzip git git-core libc-client-dev libkrb5-dev 
    &&   rm -r /var/lib/apt/lists/*
      - docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext- 
    install   -j$(nproc) imap
      - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin 
    -- filename=composer
    - composer install
    - vendor/bin/phpunit
    
    - step:
    # set HEROKU_API_KEY and HEROKU_APP_NAME environment variables
    # set clone `depth: full' as described here: https://confluence.atlassian.com/x/Y9- 
      5Mw
      name: Deploy to Heroku
      deployment: test # set to test, staging or production
    # trigger: manual # uncomment to have a manual step
      - apt-get update && apt-get install -y unzip git git-core libc-client-dev libkrb5- 
        dev && rm -r /var/lib/apt/lists/*
      - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD
    

相关问题