Last Updated: December 30, 2020
·
3.239K
· corysimmons

Deploying BitBucket Repos with Github for Windows to WebFaction

Github for Windows for BitBucket

=

  • Download Github for Windows
  • Clone a BitBucket repo anywhere on your system
  • Drag that repo into Github for Windows (now you can use Github for Windows to commit/sync to BitBucket)

BitBucket Deployment to WebFaction

=

  • Download WinSCP
  • Login to your WF account via SFTP
  • Open Putty from WinSCP toolbar (icon with 2 computers and a lightning bolt)
  • Navigate to your hidden .ssh folder (this is where all your .ssh key stuff goes)

    cd ~/.ssh

  • Generate ssh key pair of the rsa type (that's what the -t flag is)

    ssh-keygen -t rsa

  • Copy your public key

    cat id_rsa.pub

  • Paste your public key to Account Settings > SSH Keys in BitBucket

Pulling Changes from BitBucket

=

  • Clone your BitBucket repo to a folder in your site (add a . at the end of the clone command to clone the contents of the repo). Use SSH clone so it stores the password
  • Inside of pull.php

    <? `git pull`;

  • Now go to BitBucket > foo_project Repo > Settings > Services and add a POST Service Hook that polls fooproject.com/pull.php

  • Update your local repo, push with Github for Windows, and look at fooproject.com for the changes

Thanks Dejan! https://twitter.com/dekomote

1 Response
Add your response

Dont' you feel this is rather unsafe? Any POST request to fooproject.com/pull.php will launch a pull. I'm asking because I want to know and simply feel a bit reluctant to use this like that.

over 1 year ago ·