Skip to content

Commit

Permalink
WIP: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alunduil committed Aug 25, 2018
0 parents commit 3c3f956
Show file tree
Hide file tree
Showing 23 changed files with 751 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_nix
126 changes: 126 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@

# Created by https://www.gitignore.io/api/python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

### Python Patch ###
.venv/

### Python.VirtualEnv Stack ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json


# End of https://www.gitignore.io/api/python
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2011, 2015 iXsystems, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 changes: 40 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
Description
---

ZFS_ Replicate Utility

A small command line utility to handle remote replication of ZFS_ snapshots
using SSH_.

---
Getting Started
---

Usage is pretty straight-forward and documented in the command's help output.
For more information on ZFS_ snapshots, see:
`Working With Oracle Solaris ZFS Snapshots and Clones <https://docs.oracle.com/cd/E26505_01/html/E37384/gavvx.html#scrolltoc>`_.

---
Compared to Other Tools
---

TODO

---
Reporting Issues
---

Any isseus discovered should be recorded on
`Github <https://github.com/alunduil/zfs-replicate>`_. If you believe you've
found an error or have a suggestion for a new feature, please ensure that it is
reported.

If you would like to contribute a fix or new feature, please submit a pull
request. This project follows
`git flow <http://nvie.com/posts/a-successful-git-branching-model/>`_ and
utilizes travis_ to automatically check pull requests before a manual review.

.. _SSH: https://www.openssh.com/
.. _trafis: https://travis-ci.org/aunduil/zfs-replicate
.. _ZFS: http://open-zfs.org/wiki/System_Administration
45 changes: 45 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ buildPythonApplication, click, glibcLocales, hypothesis
, pylint, pytest, python, stdenv
}:
buildPythonApplication rec {
pname = "zfs-replicate";
version = "1.0.0";
name = "${pname}-${version}";

src = ./.;

checkInputs = [
hypothesis
pylint
pytest
];

buildInputs = [
glibcLocales
];

propagatedBuildInputs = [
click
];

postPatch = ''
patchShebangs bin
'';

doCheck = true;

checkPhase = ''
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
pylint zfs/replicate
pytest
'';

meta = with stdenv.lib; {
homepage = https://github.com/alunduil/zfs-replicate;
description = "ZFS Snapshot Replicator";
license = licenses.bsd2;
maintainers = with maintainers; [ alunduil ];
};
}
35 changes: 35 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[metadata]
name = zfs-replicate
version = 1.0.0
description = ZFS Snapshot Replicator

license = BSD-2

author = Alex Brandt
author_email = [email protected]

url = https://github.com/alunduil/zfs-replicate

[options]
setup_requires =
pytest-runner
install_requires =
click
tests_require =
hypothesis
pytest
packages =
zfs.replicate
zfs.replicate.cli
zfs.replicate.ssh.cipher
provides =
zfs.replicate
zfs.replicate.cli
zfs.replicate.ssh.cipher

[options.entry_points]
console_scripts =
zfs-replicate = zfs.replicate.cli:main

[aliases]
test = pytest
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools import setup; setup()
11 changes: 11 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let
dependencies = ps: [
ps.click
ps.hypothesis
ps.pylint
ps.pytest
];

pkgs = import <nixpkgs> { };
in
(pkgs.python36.withPackages dependencies).env
3 changes: 3 additions & 0 deletions zfs/replicate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""ZFS replicate module."""

from . import subprocess
Loading

0 comments on commit 3c3f956

Please sign in to comment.