Skip to content

Commit

Permalink
Merge pull request #65 from OrBin/hotfix/deployment-fix
Browse files Browse the repository at this point in the history
Fixed tag in build
  • Loading branch information
meirhalachmi committed Jun 7, 2019
2 parents 5786c1e + ccf66ec commit 0c6a750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='gramhopper',
version='2.0.0',
version='2.0.1',

description='A bot platform for automatic responses based on various triggers',
long_description=LONG_DESCRIPTION,
Expand Down
7 changes: 4 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@


DEFAULT_DOCKER_IMAGE = 'orbin/gramhopper'
DEFAULT_DOCKER_TAG = 'latest'
DOCKER_IMAGE_ENV_VARIABLE = 'DOCKER_IMAGE_TAG'
TASK_SUCCESS_CODE = 0
TASK_FAILURE_CODE = 1


@task
def build(context, package=True, docker_image=True, docker_tag=DEFAULT_DOCKER_IMAGE, docs=False):
def build(context, package=True, docker_image=True, docker_tag=DEFAULT_DOCKER_TAG, docs=False):
if package:
print('Building package...')
context.run('python setup.py sdist bdist_wheel', echo=True)
Expand All @@ -20,11 +21,11 @@ def build(context, package=True, docker_image=True, docker_tag=DEFAULT_DOCKER_IM
print('Building docker image...')

# If not specified the tag as a flag, the tag from the environment variable is preferred
if docker_tag == DEFAULT_DOCKER_IMAGE and \
if docker_tag == DEFAULT_DOCKER_TAG and \
DOCKER_IMAGE_ENV_VARIABLE in os.environ:
docker_tag = os.environ[DOCKER_IMAGE_ENV_VARIABLE]

context.run(f'docker build -t {docker_tag} .', echo=True)
context.run(f'docker build -t {DEFAULT_DOCKER_IMAGE}:{docker_tag} .', echo=True)

if docs:
build_docs(context)
Expand Down

0 comments on commit 0c6a750

Please sign in to comment.