我花了几个小时才发现这个thread,但是解决方案并没有帮助我。
问题是,当我将更改推送到Bitbucket并然后将其推送到Heroku 时,找不到 git命令。< / p>
请在指向pastebin的链接中看到我的bitbucket-pipelines.yml
。
当管道步骤“部署到Heroku”运行时,它会中止说
+ git push
https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD
bash: git: command not found
在构建设置中,git的安装成功完成。参见screenshot。
为什么git命令之后失败?
谢谢!
答案 0 :(得分: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