add deploy command

This commit is contained in:
Matthew Scragg 2014-11-11 14:48:11 -06:00
parent 7aa0ef7af5
commit c214f9ac9a
2 changed files with 12 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import sys
import os import os
import pip import pip
import time import time
import subprocess
# called to discover commands in modules # called to discover commands in modules
app = create_app() app = create_app()
@ -373,5 +374,15 @@ def version():
green(__version__) green(__version__)
@cli.command(add_help_option=False)
def deploy():
""" Deploy to PyPI and docker hub
"""
call("python setup.py sdist upload", shell=True)
call("sudo docker build --no-cache -t realms/realms-wiki %s/docker" % app.config['APP_PATH'], shell=True)
id_ = json.loads(Popen("sudo docker inspect realms/realms-wiki".split(), stdout=subprocess.PIPE).communicate()[0])[0]['Id']
call("sudo docker tag %s realms/realms-wiki:%s" % (id_, __version__), shell=True)
call("sudo docker push realms/realms-wiki", shell=True)
if __name__ == '__main__': if __name__ == '__main__':
cli() cli()

View file

@ -1 +1 @@
__version__ = '0.4.6' __version__ = '0.4.8'