add deploy command

This commit is contained in:
Matthew Scragg 2014-11-11 14:48:11 -06:00
vanhempi 7aa0ef7af5
commit c214f9ac9a
2 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa

Näytä tiedosto

@ -8,6 +8,7 @@ import sys
import os
import pip
import time
import subprocess
# called to discover commands in modules
app = create_app()
@ -373,5 +374,15 @@ def 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__':
cli()

Näytä tiedosto

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