4 Commits
0.3.1 ... 0.3.2

Author SHA1 Message Date
Einar Forselv
2cbc5aa6fa bump version 2019-12-06 07:36:30 +01:00
Einar Forselv
ffa2dfc119 rcb version 2019-12-06 07:35:14 +01:00
Einar Forselv
cfc92b2284 Bug: The log stream from docker can be str or bytes
We don't know why this is the case..
2019-12-06 07:30:39 +01:00
Einar Forselv
216202dec7 Bump version 2019-12-06 06:07:03 +01:00
6 changed files with 19 additions and 8 deletions

View File

@@ -22,8 +22,7 @@ copyright = '2019, Zetta.IO Technology AS'
author = 'Zetta.IO Technology AS' author = 'Zetta.IO Technology AS'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '0.3.0' release = '0.3.2'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------

View File

@@ -2,6 +2,7 @@
- Update version in `setup.py` - Update version in `setup.py`
- Update version in `docs/conf.py` - Update version in `docs/conf.py`
- Update version in `restic_compose_backup/__init__.py`
- Build and tag image - Build and tag image
- push: `docker push zettaio/restic-compose-backup:<version>` - push: `docker push zettaio/restic-compose-backup:<version>`
- Ensure RTD has new docs published - Ensure RTD has new docs published
@@ -12,9 +13,9 @@ When releasing a bugfix version we need to update the
main image as well. main image as well.
```bash ```bash
docker build . --tag zettaio/restic-compose-backup:0.3 docker build src --tag zettaio/restic-compose-backup:0.3
docker build . --tag zettaio/restic-compose-backup:0.3.1 docker build src --tag zettaio/restic-compose-backup:0.3.2
docker push zettaio/restic-compose-backup:0.3 docker push zettaio/restic-compose-backup:0.3
docker push zettaio/restic-compose-backup:0.3.1 docker push zettaio/restic-compose-backup:0.3.2
``` ```

View File

@@ -0,0 +1 @@
__version__ = '0.3.2'

View File

@@ -35,7 +35,13 @@ def run(image: str = None, command: str = None, volumes: dict = None,
line = "" line = ""
while True: while True:
try: try:
line += next(stream).decode() # TODO: figure out why..
# Apparently the stream can be bytes or strings.
data = next(stream)
if isinstance(data, bytes):
line += data.decode()
elif isinstance(data, str):
line += data
if line.endswith('\n'): if line.endswith('\n'):
break break
except StopIteration: except StopIteration:

View File

@@ -42,6 +42,10 @@ def main():
elif args.action == 'alert': elif args.action == 'alert':
alert(config, containers) alert(config, containers)
elif args.action == 'version':
import restic_compose_backup
print(restic_compose_backup.__version__)
def status(config, containers): def status(config, containers):
"""Outputs the backup config for the compose setup""" """Outputs the backup config for the compose setup"""
@@ -205,7 +209,7 @@ def parse_args():
parser = argparse.ArgumentParser(prog='restic_compose_backup') parser = argparse.ArgumentParser(prog='restic_compose_backup')
parser.add_argument( parser.add_argument(
'action', 'action',
choices=['status', 'snapshots', 'backup', 'start-backup-process', 'alert', 'cleanup'], choices=['status', 'snapshots', 'backup', 'start-backup-process', 'alert', 'cleanup', 'version'],
) )
parser.add_argument( parser.add_argument(
'--log-level', '--log-level',

View File

@@ -3,7 +3,7 @@ from setuptools import setup, find_namespace_packages
setup( setup(
name="restic-compose-backup", name="restic-compose-backup",
url="https://github.com/ZettaIO/restic-compose-backup", url="https://github.com/ZettaIO/restic-compose-backup",
version="0.3.0", version="0.3.2",
author="Einar Forselv", author="Einar Forselv",
author_email="eforselv@gmail.com", author_email="eforselv@gmail.com",
packages=find_namespace_packages(include=['restic_compose_backup']), packages=find_namespace_packages(include=['restic_compose_backup']),