Skip to content

Instantly share code, notes, and snippets.

View nottrobin's full-sized avatar

Robin Winslow nottrobin

View GitHub Profile
@nottrobin
nottrobin / gist:a0693c00086a362ba6d6
Created January 27, 2015 16:49
Convert Git to Bazaar
bzr init-repo bzr-repo # Create a new Bazaar repository tree
git fast-export -M --all | (cd bzr-repo; bzr fast-import -) # Export Git history into Bazaar
@nottrobin
nottrobin / gist:851045637af7b628750a
Created January 27, 2015 16:50
Check converted Bazaar history
cd bzr-repo/trunk # Open the "trunk" branch (equivalent of "master")
bzr log | less # Check your revision history is in Bazaar
@nottrobin
nottrobin / set up git and bzr project.sh
Last active August 29, 2015 14:14
Setting up a project with both .gitignore and .bzrignore files
$ cat .gitignore
.bzr/
.sass-cache/
bzr-repo/
*.pyc
$ cat .bzrignore
.git/
.sass-cache/
bzr-repo/
*.pyc
@nottrobin
nottrobin / install git bzr pip.sh
Last active August 29, 2015 14:14
Install Git, Bazaar and Pip
sudo apt install git bzr python-pip
@nottrobin
nottrobin / bzr-sync user permissions.sh
Last active August 29, 2015 14:14
Setup user permissions for the bzr-sync server
sudo adduser bzr-sync # Create new bzr-sync user
sudo su bzr-sync # Change to bzr-sync user
ssh-keygen # Create new RSA key
cat ~/.ssh/id_rsa.pub # Add this public key to Github and Launchpad
# Now check we can clone your github projects properly
git clone git@github.com:example/example-project
rm -r example-project # Once we've tested this, delete the project again
# And check we can branch and push to launchpad projects
bzr branch lp:example-project # Branch a project
cd example-project # Change to its directory
@nottrobin
nottrobin / clone bzr-sync.sh
Last active August 29, 2015 14:14
Cloning the bzr-sync project
# Clone the repository, and make it owned by our user (bzr-sync)
sudo git clone git@github.com:ubuntudesign/bzr-sync.git /srv/bzr-sync
sudo chown -R bzr-sync:bzr-sync /srv/bzr-sync
# Install python dependencies
sudo pip install -r /srv/bzr-sync/requirements.txt
@nottrobin
nottrobin / prepare bzr-sync project.sh
Created January 28, 2015 14:28
Clone bzr-sync and install dependencies
# Clone the repository, and make it owned by our user (bzr-sync)
sudo git clone git@github.com:ubuntudesign/bzr-sync.git /srv/bzr-sync
sudo chown -R bzr-sync:bzr-sync /srv/bzr-sync
# Install python dependencies
sudo pip install -r /srv/bzr-sync/requirements.txt
@nottrobin
nottrobin / run gunicorn for bzr-sync.sh
Created January 28, 2015 14:29
Gunicorn command for running the bzr-sync server
gunicorn --keyfile /srv/bzr-sync/certs/bzr-sync.key --certfile /srv/bzr-sync/certs/bzr-sync.cert --pythonpath /srv/bzr-sync --bind 0.0.0.0:9052 wsgi:application
@nottrobin
nottrobin / bzr-sync.conf
Created January 28, 2015 14:32
upstart file for bzr-sync server
# /etc/init/bzr-sync.conf
# A WSGI application
# to sync a github repository to a launchpad one
description "BZR sync"
start on runlevel [2345]
stop on runlevel [016]
@nottrobin
nottrobin / start bzr-sync.sh
Created January 28, 2015 14:32
Start the bzr-sync upstart service
sudo start bzr-sync