Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

feat: add rollback command #166

Merged
merged 1 commit into from Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions blackbelt/commands/rollback.py
@@ -0,0 +1,12 @@
import click

from blackbelt.deployment import (
rollback_production
)


@click.group(invoke_without_command=True, help="""
Rollback latest version from production environments (prod, pre, qa)
""")
def cli():
rollback_production()
8 changes: 8 additions & 0 deletions blackbelt/deployment.py
Expand Up @@ -27,3 +27,11 @@ def deploy_production():
check_output(['grunt', 'deploy-slug', '--app=apiary-staging-qa'])
check_output(['grunt', 'deploy-slug', '--app=apiary-staging-pre'])
check_output(['grunt', 'deploy-slug'])

def rollback_production():

post_message("Rollback production for all environments (prod, qa, pre)", "#deploy-queue")

check_call(['grunt', 'rollback', '--app=apiary-staging-qa'])
check_call(['grunt', 'rollback', '--app=apiary-staging-pre'])
check_call(['grunt', 'rollback'])