Ejemplo n.º 1
0
def step_impl_then(context):
    deployments = marathon_tools.load_deployments_json('fake_deployments_json_service', soa_dir='fake_soa_configs')
    expected_deployments = {
        'fake_deployments_json_service:paasta-test_cluster.test_instance': {
            'force_bounce': None,
            'desired_state': 'start',
            'docker_image': 'services-fake_deployments_json_service:paasta-%s' % context.expected_commit
        }
    }
    assert expected_deployments == deployments, "actual: %s\nexpected:%s" % (deployments, expected_deployments)
    shutil.rmtree(context.test_git_repo_dir)
Ejemplo n.º 2
0
def get_actual_deployments(service, soa_dir):
    deployments_json = load_deployments_json(service, soa_dir)
    if not deployments_json:
        sys.stderr.write("Warning: it looks like %s has not been deployed anywhere yet!\n" % service)
    # Create a dictionary of actual $service Jenkins deployments
    actual_deployments = {}
    for key in deployments_json:
        service, namespace = key.encode('utf8').split(':')
        if service == service:
            value = deployments_json[key]['docker_image'].encode('utf8')
            sha = value[value.rfind('-') + 1:]
            actual_deployments[namespace.replace('paasta-', '', 1)] = sha
    return actual_deployments
def step_impl_then(context):
    deployments = marathon_tools.load_deployments_json(
        'fake_deployments_json_service', soa_dir='fake_soa_configs')
    expected_deployments = {
        'fake_deployments_json_service:paasta-test_cluster.test_instance': {
            'force_bounce':
            None,
            'desired_state':
            'start',
            'docker_image':
            'services-fake_deployments_json_service:paasta-%s' %
            context.expected_commit
        }
    }
    assert expected_deployments == deployments, "actual: %s\nexpected:%s" % (
        deployments, expected_deployments)
    shutil.rmtree(context.test_git_repo_dir)