{ "info": { "author": "Jan Willems", "author_email": "jw@elevenbits.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP" ], "description": "# Synchronise #\r\n\r\nThis is the synchronise module.\r\n\r\n### Overview ###\r\n\r\nThis module allows you to synchronise BitBucket Mercurial to GitHub Git \r\nprojects.\r\n\r\n### How do you make the synchonisation work? ###\r\n\r\nThere is an example directory. Install it and follow these rules to \r\nsynchronise your project called on Bitbucket with user called \r\n to Github:\r\n\r\n1. Make sure your Bitbucket repository is Mercurial based. Your project \r\n can be private or public.\r\n2. In the Settings of your project (click the cogwheel), select the \r\n Hooks section. Select the 'POST' hook and point it to the URL you \r\n installed this module in. \r\n The URL needs to be public. If that would be a problem, there is already \r\n a synchroniser installed at \r\n `http://api.elevenbits.com/synchronise/`. You can use that\r\n if you want to.\r\n3. Make sure you have a related GitHub project which will host a copy of the \r\n Bitbucket repository. If the GitHub project has a different user or a\r\n different name, you should adapt the 'POST' hook, e.g. \r\n `http://api.elevenbits.com/synchronise/?user=foo&project=fizz`.\r\n4. In the GitHub select this and visit its Settings page.\r\n Add 'Synchroniser' as Collaborator.\r\n5. Done!\r\n\r\nFrom now on, when you do a push to your Bitbucket project, the module will \r\nbe informed by the POST and push it to GitHub as the Synchroniser collaborator.\r\nThis will immediately make sure the GitHub project will be synchronised with\r\nthe Butbucket one.\r\n\r\n### How does it work? ###\r\n\r\nEach time a Mercurial push arrives at Bitbucket, it will send a request\r\nto the URL specified in the POST hook of the pushed project.\r\n\r\nThe JSON content of the POST is clearly explained\r\n[at the Bitbucket website](https://confluence.atlassian.com/display/BITBUCKET/POST+hook+management).\r\n\r\nThe '/synchronise/' link will parse the JSON and see if it is a valid POST.\r\n\r\nWhen it is a valid POST it will clone the Mercurial repository specified in \r\nit using [hgapi](https://bitbucket.org/haard/hgapi). Then it will make\r\nsure that the [hggit](https://bitbucket.org/durin42/hg-git) extension is \r\nenabled and an extra `github` path is added. After bookmarking the tip \r\nas master (via `hg bookmark master`), it will push the repo to GitHub (via\r\n`hg push github`). Since Synchroniser is a collaborator the push will succeed.\r\n\r\nSee the code for more information.\r\n\r\n### Error codes ###\r\n\r\nSuccessful synchonisation request will return 200 with an informational\r\nmessage. The synchroniser will return 400 when a request was unsuccessfully\r\nhandled.\r\n\r\nSome examples when a 400 would be returned:\r\n\r\n - When invalid request arrives (e.g. no JSON payload)\r\n - The github project specified in the request does not exist\r\n - The user specified in the request the user does not exist\r\n - No Synchroniser collaborator is specified in the GitHub project\r\n\r\nA 500 will be returned when something bad happened at the server side, and\r\nis not caused by an invalid request. For example the `hggit` plugin is not\r\navailable or `hgapi` misbehaved.\r\n\r\n### Can I create my own Synchroniser? ###\r\n\r\nYes you can! All the code is available here. When you have a server \r\navailable, you can point the POST hook to your own machine.\r\n\r\nHere is a first draft of the installation process using `nginx` and `uwsgi`:\r\n\r\n* Make sure `nginx` and `uwsgi` are installed.\r\n* Add a new site configuration in `/etc/nginx`.\r\n* Add a new uwsgi configuration in `/etc/uwsgi`.\r\n* Restart both `nginx` and `uwsgi`.\r\n* Enjoy your synchronisation server!\r\n\r\n#### Notes ####\r\n\r\n* This is a Django project, and uses only Python based dependencies: hgapi\r\n and hggit.\r\n* The database is not really needed. The default sqlite3 will do for now.\r\n* To install UWSGI:\r\n\r\n - Do not install using your distribution methods. So, do not use `apt-get`,\r\n `yum` or `pakman`.\r\n - Please download the latest uwsgi: http://projects.unbit.it/downloads/uwsgi-2.0.6.tar.gz\r\n - Build plugins for it:\r\n `python2.7 uwsgiconfig.py --plugin plugins/python core python27`\r\n `python3.4 uwsgiconfig.py --plugin plugins/python core python34`\r\n - Create two ini files, one for Python 2.7 (two.ini), another one for Python\r\n 3 (three.ini):\r\n\r\n##### two.ini ##### \r\n\r\n`\r\n[uwsgi]\r\nplugin-dir = /home/jw/plugins\r\nplugin = python27\r\nchdir = /home/jw/apps/two\r\nmaster = true\r\nthreads = 2\r\nprocesses = 4\r\nhttp-socket = :9090\r\nwsgi-file = foobar.py\r\n`\r\n\r\n##### three.ini #####\r\n\r\n`\r\n[uwsgi]\r\nplugin-dir = /home/jw/plugins\r\nplugin = python34\r\nchdir = /home/jw/apps/three\r\nmaster = true\r\nthreads = 2\r\nprocesses = 4\r\nhttp-socket = :8080\r\nwsgi-file = fizzbuzz.py\r\n`\r\n\r\nStart the uwsgi emperor with `uwsgi --emperor `\r\nand see the system handle to different python releases!\r\n\r\n### Contribution guidelines ###\r\n\r\n* Please write tests for me?\r\n* Do not hesitate to do a code review.\r\n* When writing code, do follow [PEP8](http://legacy.python.org/dev/peps/pep-0008/).\r\n But use `'` before `\"`; so `print('Hello there')` and \r\n `foo = '\"Hej!\", said Fritz'` are valid, while `print(\"Foobar\")` is not. \r\n\r\n### Who do I talk to? ###\r\n\r\n* Mail jw@elevenbits.com for info, help, support,...\r\n* Leave requests and bug reports on the issues page\r\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/elevenbits/django-synchroniser", "keywords": "synchronise bitbucket github", "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "django-synchroniser", "package_url": "https://pypi.org/project/django-synchroniser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-synchroniser/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/elevenbits/django-synchroniser" }, "release_url": "https://pypi.org/project/django-synchroniser/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "django-synchroniser automagically synchronises Bitbucket Mecurial base projects to GitHub (Git based) projects", "version": "0.2.0" }, "last_serial": 1222707, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "a90c884c4bc96d31532b9ae0fd1ae820", "sha256": "c4cb68940239891536ccb5d5012ee6836eafdf51e9155a3e74bf584151f607e2" }, "downloads": -1, "filename": "django-synchroniser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a90c884c4bc96d31532b9ae0fd1ae820", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8056, "upload_time": "2014-09-13T08:57:48", "url": "https://files.pythonhosted.org/packages/42/20/2431d5b4ef331ae23cac7c3ad9b4ab74ff287b67baa5d7275ae55e639f7b/django-synchroniser-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a90c884c4bc96d31532b9ae0fd1ae820", "sha256": "c4cb68940239891536ccb5d5012ee6836eafdf51e9155a3e74bf584151f607e2" }, "downloads": -1, "filename": "django-synchroniser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a90c884c4bc96d31532b9ae0fd1ae820", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8056, "upload_time": "2014-09-13T08:57:48", "url": "https://files.pythonhosted.org/packages/42/20/2431d5b4ef331ae23cac7c3ad9b4ab74ff287b67baa5d7275ae55e639f7b/django-synchroniser-0.2.0.tar.gz" } ] }