{
"info": {
"author": "Eliot Berriot",
"author_email": "contact@eliotberriot.com",
"bugtrack_url": null,
"classifiers": [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7"
],
"description": "Note: fabpress is in early development, use with caution\n\nIf you want to developp locally with Wordpress, you usually have to follow these steps: \n\n- install a local copy of Wordpress\n- import your production MySQL database\n- search and replace permalinks in database (``http://mysite.com`` to ``http://localhost/dev/mysite``)\n- install all your plugins and themes with correct versions\n- download media files\n\nThen, each time there is a change on production website and you need to pull these changes, you have to go through the same steps. And the same thing happens if you want to deploy your local website in production.\n\nGoing through these steps by hand is a nightmare and this is why I wrote fabpress: I wanted a command-line tool that would let me mirror a Wordpress installation via a single command.\n\nWhat is fabpress ?\n==================\n\n- a bunch of scripts, written in Python on top of `Fabric `_ and `WP-CLI `_, two awesome tools\n- a way to pull/push database, media files, themes, plugins from/to your production wordpress website\n- a command-line tool, tested on ArchLinux and Debian, that could probably work on Mac OS and other Linux distributions\n- free (as in free speech and free beer), open-source, licensed under BSD\n\nWhat is *not* fabpress ?\n========================\n\n- production-ready. I use it on my projects, and it works. There is absolutely no warranty it will work for you, with your setup. **Before trying it, please, backup your data**. I mean it, seriously.\n\nRequirements\n============\n\nOn local machine\n****************\n\n- Python 2.7\n- Fabric for managing connexion to server and calling commands\n\nOn remote machine\n*****************\n\n- SSH access\n\nOn both\n*******\n\n- `WP-CLI `_ for dealing with most of the Wordpress stuff\n- A Linux system (fabpress was developped and tested on Archlinux and Debian Wheezy)\n\nInstallation\n============\n\nRecommanded installation procedure requires `pip `_, but you can also use ``easy_install``. Please install pip before continuing.\n\nFabric\n******\n\nInstall Fabric your local machine::\n\n sudo pip install fabric\n\nWP-CLI\n******\n\nFollow the procedure detailed on `WP-CLI `_ website, on your local and production machines.\n\nFabpress\n********\n\nFabpress is available on `PyPi `_. Install it on your local machine::\n\n pip install fabpress --user\n\nThis method will also download and install Fabric \n\nConfiguration\n=============\n\nFirst, move into your project directory::\n\n cd /home/user/projects/mysite\n\nCreate a ``fabfile.py`` file::\n\n echo 'from fabpress import tasks as fp' >> fabfile.py\n\nThen, generate a config file::\n \n fab fp.config.create\n\nThis will create a ``fab_settings.py`` file in your project directory. Fell free to add it to your VCS ignored files.\n\nYou can now edit the file (it is heavily commented)::\n\n nano fab_settings.py\n\nImport your settings in your ``fabfile.py``::\n \n echo \"import fab_settings\" >> fabfile.py \n\nAfter that, well, you're almost good to go. Remember to create a MySQL database for your local instance.\n\nA bit of theory\n===============\n\nTasks\n*****\n\nA task is an action you can run from command line, using the following notation::\n\n fab command:argument1=value,argument2=\"value\"\n\n # Quotes and arguments name are not mandatory\n fab command:value1,value2\n\n # Some tasks just don't need arguments\n fab command\n\nYou can list available commands via ``fab -l`` and get additionnal informations about a fabpress task, with ``fab fp.:help``.\n\nTargets\n*******\n\nIn fabpress, many tasks can be run independantly on remote or local Wordpress instance. For exemple, take the following tasks::\n\n fab fp.db.sync:local\n fab fp.db.sync:remote\n\nThe first one will create a backup of your remote database, download it and import it into your local wordpress instance. The second one will do the opposite: backup your local database, upload it and import it into your remote instance.\n\nWhen a task require a target argument, which value can be either ``remote`` or ``local``, it usually means data (database, media files, plugins, themes...) will be imported INTO your target wordpress instance. Some tasks do not import data, but still require a target: ``fab fp.db.reset:`` will reset all database tables of targeted installation. \n\nNote that fabpress help and documentation sometimes mentions ``origin``. This term is a shortcut for designating the opposite of a target. With the following command ``fab.main.sync:local`` your target is ``local``, and ``origin`` is your remote installation, from where data will be imported. \n\nIf you run ``fab.main.sync:remote``, ``origin`` designate your local Wordpress instance.\n\nExample workflow\n================\n\nFirst, we move to our project directory::\n\n cd /home/user/projects/mysite\n\nLet's mirror the production website, so we can use it locally::\n\n fab fp.main.mirror:local\n\n # typical output\n\n This is an important choice. Do you want to continue ? [y/N] y\n Running main.mirror [on local]...\n Running base.collect_data [on remote]...\n Running main.download [on local]...\n Changing permissions of /var/www/mysite to 770\n wp-config.php was copied from sample. Do you want to edit it ? [Y/n] y\n Edit your file located at /var/www/mysite/wp-config.php then relaunch this command\n\n fab fp.main.mirror:local\n This is an important choice. Do you want to continue ? [y/N] y\n\n Existing wp-config.php file found\n Running main.sync [on local]...\n Syncing databases (from remote to local)\n Running db.export [on remote]...\n Running db.import [on local]...\n Creating a safety backup of local database, juste in case\n Downloading backup from remote\n Importing backup.sql into local database...\n Deleting useless SQL backups...\n Running db.fix_permalinks [on local]...\n Updating URL(s) from mysite.com to localhost/mysite...\n Running theme.sync [on local]...\n Skipping theme blast: it is listed in ignored_themes\n Running plugin.sync [on local]...\n Running media.sync [on local]...\n Syncing media files from remote to local (please, be patient, this may take some time)\n Done.\n\n\nWe can now open ``http://localhost/mysite`` with any web browser, and browse the local copy of our production website.\nIf you encounter 404 errors, login at ``http://localhost/mysite/wp-admin`` and update your permalinks (Settings > Permalinks). You should not have to do it again after that.\n\nThen, it's time to work. We install themes, plugins, create new pages and posts, import media files...\n\nWhen we're done and want to push your local changes in production, we just run::\n\n fab fp.main.push\n\nLater, if we want to import changes from production::\n\n fab fp.main.pull\n\nHooks\n=====\n\nSometimes, you want to do something when a task is run. For example, pulling from your theme's Git repository when you run ``fp.theme.sync`` on your remote installation. Hooks are here for that::\n\n # hooks.py (create this in the same directory as your fab_settings.py)\n\n from fabric.api import run, cd\n def pull_theme():\n with cd(\"/var/www/mysite/wp-content/themes/mytheme\"):\n run(\"git pull\")\n\n\n # fab_settings.py\n\n import hooks\n\n remote = {\n\n # ...\n\n \"hooks\": {\n \"theme.sync\": hooks.pull_theme\n },\n }\n\nAvailable tasks\n===============\n\nOutput from ``fab -l``::\n \n fp.config.create Create a config file from fabpress sample\n fp.db.clear_backups Remove backup files on target\n fp.db.export Export the database from target installation to the given path\n fp.db.fix_permalinks Search and replace all occurence of origin domain with target domain\n fp.db.import Import the database dump at origin path to the target\n fp.db.reset Delete all tables in target database\n fp.db.sync Sync target database with origin, replacing origin permalinks with target permalinks\n fp.fs.drop Remove all files of target, including target directory\n fp.main.download Download at target a copy of origin Wordpress files (version and languages preserved)\n fp.main.drop Delete target files and database. Will also delete the installation parent directory.\n fp.main.help Get some help\n fp.main.mirror Create at target an exact mirror of origin wordpress installation\n fp.main.pull Sync database, themes, plugins and media files from remote to local installation\n fp.main.push Sync database, themes, plugins and media files from local to remote installation\n fp.main.sync Pull origin database, themes, plugins and media files to target\n fp.main.wp Run a wp-cli command on the target. You don't need to prefix it with 'wp', it will be added automatically\n fp.media.sync Download origin media files to target\n fp.plugin.sync Download and activate origin plugins on target\n fp.theme.sync Download and activate origin themes on target\n\nLimitations\n===========\n\n- For some reasons, when mirroring a Wordpress installation for the first time, you'll have to manually save the permalinks from the admin, in order to load Custom Posts Types permalinks. Else, accessing a CPT detail page would raise a 404.\n- Will only download Themes and Plugins that are available on wordpress.org.\n\n\nTo-do list\n==========\n\n- sync wordpress versions\n- add support for more than two targets\n\nChanges\n=======\n\n0.1.1 - 29/10/2014:\n*****************\n- Syncing DB now clear transients, which should fix some URL issues with plugins (such as Polylang)\n\n0.1 - 29/09/2014:\n*****************\n- initial release\n\nContribute\n==========\n\nContributions, bug reports, and \"thank you\" are welcomed. Feel free to contact me at .\n\nLicense\n=======\n\nThe project is licensed under BSD licence.",
"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/EliotBerriot/fabpress",
"keywords": null,
"license": "BSD",
"maintainer": null,
"maintainer_email": null,
"name": "fabpress",
"package_url": "https://pypi.org/project/fabpress/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/fabpress/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/EliotBerriot/fabpress"
},
"release_url": "https://pypi.org/project/fabpress/0.1.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Wordpress local installation and deployment made simple",
"version": "0.1.1"
},
"last_serial": 1286830,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "9482c187df87c9358efe1d0aeb8129d6",
"sha256": "920f359725192d0f3c5fc90afe27776fbf16ceee4a2eeea3bf34bb76d68979a5"
},
"downloads": -1,
"filename": "fabpress-0.1.tar.gz",
"has_sig": false,
"md5_digest": "9482c187df87c9358efe1d0aeb8129d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15671,
"upload_time": "2014-09-29T11:16:26",
"url": "https://files.pythonhosted.org/packages/08/70/7eefcd09e88b94eea9f836ba9439887cf44d95b8b8d31f9d0eb931777bd4/fabpress-0.1.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "cfa18405ae15300d0337ed07f7b7993a",
"sha256": "ab8bb1da4c69cffb7d9536b9bfe36d6cf2a602d37d019bb2b6e50da5a8f8d9e9"
},
"downloads": -1,
"filename": "fabpress-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "cfa18405ae15300d0337ed07f7b7993a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15849,
"upload_time": "2014-10-29T10:16:43",
"url": "https://files.pythonhosted.org/packages/d1/e3/4e867dece894cd5d8b98ef8d11d53eb1e55a74dfd4ce80cf960b66b9bc26/fabpress-0.1.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cfa18405ae15300d0337ed07f7b7993a",
"sha256": "ab8bb1da4c69cffb7d9536b9bfe36d6cf2a602d37d019bb2b6e50da5a8f8d9e9"
},
"downloads": -1,
"filename": "fabpress-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "cfa18405ae15300d0337ed07f7b7993a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15849,
"upload_time": "2014-10-29T10:16:43",
"url": "https://files.pythonhosted.org/packages/d1/e3/4e867dece894cd5d8b98ef8d11d53eb1e55a74dfd4ce80cf960b66b9bc26/fabpress-0.1.1.tar.gz"
}
]
}