Package: durant
What is itDurant is a simple deployment tool for git repositories. It sends the files to servers using rsync over ssh. Basically, this means that you can use durant to deploy any kind of application, no matter the language used.Latest versionDurant is a work in progress, currently in beta phase. Latest available version is 0.2.3.RequirementsLinux operating system and:python (2.6, 2.7, 3.3, 3.4)gitrsyncInstallationTo install first make sure you have pip installed. Then simply run:$pipinstalldurantThis will install durant globally. If you want to install for your user only use the--useroption and make sure that you have$HOME/.local/binadded to your PATH:$pipinstall--userdurantUsageConfiguration fileFirst thing you need to set up is a configuration file. This is needed in order for the tool to know what and where to do the deployments. The configuration is nameddurant.confand you have to place it in the root directory where your projects resides.A sample config file is provided in this repository. You can define multiple stages to deploy to, each section of the config file representing a deployment stage. As you can see in the sample file, the structure follows the INI file format.The first section of the file, calledDEFAULT, holds general options such as the project’s repository, files to exclude when deploying or the local path where to clone the project before performing the deploy.[DEFAULT]repository:/repository/path/or/urltemp_dir:/local/directory/where/to/clone/before/deployexclude:.git, .gitignore, .gitmodulesThe sections that follow can be as many as your deployment stages are. For instance, in the case of the production stage one configuration section could look like the following:[production]server:example.com, 127.0.0.1user:usernamebranch:masterproject_dir:/server/project/directory/rootbefore_deploy:composer install --no-dev --no-interaction --optimize-autoloadernosetestsphpunitetc.For each stage you can define the corresponding server, the username used when communicating via ssh, what branch to use, the project’s root directory on the server or some commands to execute before deployment. Please note that each of these commands must exit with return code 0 or else the deployment considers that something went wrong and halts the process, thus failing.Some of the options can take multiple values, like when declaring servers or before deploy commands. In such cases you can separate multiple values by using commas or by entering each value on a different line, properly indented.Please note that the deploy process works best if you have already setup ssh authentication for your servers by defining hosts and authentication details using the~/.ssh/configfile. If you haven’t, you can specify the identity key file to use when connecting to the server by using thessh_identityoption and also thessh_portif you use a custom ssh port.Command line toolAfter everything is setup you can start using the command line tool. As you may have guessed, you can invoke it by using the namedurant, from inside your project’s root directory:$durantdeploy[OPTIONS]<stage>If you want to test if the deploy process will perform well, without actually deploying to servers, you can specify the-noption in order to do a trial run.$durantdeploy-n<stage>This will give a view of the files that will be modified. Ihighly advice to use this option firstto check if everything will go as expected and not have any surprises.ExamplesA successfully completed deployment may look like this:In case something turns out wrong, a corresponding error is raised and the process is stopped:ContributeIf you find any bugs please feel free to open a related issue. You can also send directly a pull request with the bug fix if you want (please use the current stable branch in this case).Release HistoryPlease see the file calledHISTORY.rst.LicensingPlease see the file calledLICENSE.Release History0.2.3 (2015-05-07)Add the possibility to specify the remote to use (default is origin)Internal changes:Refactor code to use separated commandsAdd console class to better handle console outputAdd config class to handle config options0.2.2 (2015-04-19)Switch to argparse module for command line interface0.2.1 (2015-04-14)BugfixesFix rsync exclude command build error0.2.0 (2015-04-14)Use common git files such as .gitignore, .gitmodules, .gitkeep and the .git
directory as default exclude patterns when building the rsync command0.1.0 (2015-04-14)Initial public release