Deploying to Heroku with git on a bitbucket

I want to host my source on a bitpack using git because I obviously get a free private repo and I want to host my application on heroku using the source code from bitbucket.

Can I do this with the github client and the heroku dashboard. Will this work? Github is wonderful, but I don’t want everyone to see my code, and I don’t want to pay for a private repo, because its a small project.

+73
git bitbucket github heroku heroku-toolbelt
Nov 05 '12 at 20:55
source share
6 answers

Heroku deployment should work no matter where you place your code, as the Heroku CLI adds its own Git Remote for deployments. In fact, you can even use git pull from Heroku, so instead, you can technically use Heroku as a private Git repository (although not recommended). Regarding using the GitHub client to connect to bitbucket, just change the remote repository to the URL provided by bitbucket in the client settings tab.

+56
Nov 05
source share

Just add a zeiv answer that said it should work: I can confirm that it is. We use bitbucket to host git and deploy it to heroku. What you cannot do is add bitbucket replicas to your heroku account to show commit history, this function is apparently currently limited to github (heroku fault ;-)

+34
Nov 08 '12 at 22:52
source share

Interacting with Stefan - it works great. Here is what I did:

  • In fact, I was disappointed that my WP blog was updated daily, introducing everyone who switched to http://blog.example.com from the installation screen, because there was no wp-config.php.
  • Recorded at bitbucket.org.
  • Linked my bitbucket and github accounts.
  • Released my wp-blog repository from github, which I previously linked to the remote mykkku.
  • Cloned into this new fork ("git clone https: //myname@bitbucket.org/myname/wp-blog_config.git ").
  • Added correct wp-config.php.
  • Added my remote hero from this new fork ("git remote add heroku git @ heroku.com: adjective-noun-1234.git")
  • Completed and deployed to the hero ("git click" hero master ": master")
+14
Nov 07 '13 at 13:26
source share

Bitbucket now supports Pipelines , which should make it pretty easy to deploy to Heroku. Just follow this guide: https://confluence.atlassian.com/bitbucket/deploy-to-heroku-872013667.html

My bitbucket-pipelines.yml just push the leading branch on Heroku is as follows:

 image: node:6 clone: depth: full pipelines: branches: master: - step: script: - git push -f https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git $BITBUCKET_BRANCH 
+8
Feb 22 '17 at 17:01
source share

If you don’t want to work on the command line and click on the hero all the time and worry about saving SSH keys (quite annoying if you work in different blocks), then follow this guide on how to configure continuous integration using a code program. Its a free plug-in on the hero.

http://blog.codeship.io/2014/04/29/continuous-deployment-heroku-bitbucket-nodejs.html

+4
Sep 03 '14 at 7:28
source share

I found this page useful.

Install Heroku Toolbelt

If you have not already done so, log in to your Heroku account and follow the instructions to create a new SSH public key.

 $ heroku login 

Create a New Git Repository

Initialize a Git repository in a new or existing directory

 $ cd my-project/ $ git init $ heroku git:remote -a PROJECTNAME 

Expand Application

Commit your code to the repository and deploy it to Heroku using Git.

 $ git add . $ git commit -am "make it better" $ git push heroku master 

Existing Git Repository

For existing repositories just add a remote heroku server

 $ heroku git:remote -a PROJECTNAME 
+2
Aug 12 '16 at 11:31 on
source share



All Articles