Ejemplo n.º 1
0
 def deploy_stories(self, stories, from_branch, to_branch):
     # get all release objects associated with the stories
     logger = logging.getLogger('deploy')
     rolist = DeployableObject.objects.filter(pending_stories__in=stories)
     deployResult = Deployment.deploy(set(rolist), from_branch, to_branch,  testOnly = False,  retain_package = True)
     if deployResult is not None:
         if not deployResult.success:
             for dm in deployResult.messages:
                 if not dm.success:
                     logger.info('fail: {0} - {1}'.format(dm.fullName, dm.problem))
                 else:
                     logger.info('pass: {0}'.format(dm.fullName))
             raise CommandError('deployment failed')
Ejemplo n.º 2
0
def push_release_package(request, release_package_id):
    release_package = DeploymentPackage.objects.get(id=release_package_id)

    if request.method == u"POST":
        branch = Branch.objects.get(id=request.POST.get("target_env"))

        push_package = DeploymentPushStatus()
        push_package.package = release_package
        push_package.keep_package = request.POST.get("keep_generated") == "1"
        push_package.package_location = "/tmp"
        push_package.test_only = False
        push_package.target_environment = branch
        push_package.save()

        if os.fork() == 0:
            Deployment.deploy_package(push_package)
            sys.exit()

        return redirect("/release_push_status/" + str(push_package.id))

    branches = Branch.objects.filter(enabled__exact=True).order_by("order")
    data = {"release_package": release_package, "branches": branches}

    return render(request, "release_push_package.html", data)
Ejemplo n.º 3
0
def push_release_package(request, release_package_id):
    release_package = DeploymentPackage.objects.get(id=release_package_id)

    if request.method == u'POST':
        branch = Branch.objects.get(id=request.POST.get('target_env'))

        push_package = DeploymentPushStatus()
        push_package.package = release_package
        push_package.keep_package = request.POST.get('keep_generated') == '1'
        push_package.package_location = '/tmp'
        push_package.test_only = False
        push_package.target_environment = branch
        push_package.save()

        if os.fork() == 0:
            Deployment.deploy_package(push_package)
            sys.exit()

        return redirect('/release_push_status/' + str(push_package.id))

    branches = Branch.objects.filter(enabled__exact=True).order_by('order')
    data = {'release_package': release_package, 'branches': branches}

    return render(request, 'release_push_package.html', data)
Ejemplo n.º 4
0
 def deploy_stories(self, stories, from_branch, to_branch):
     # get all release objects associated with the stories
     logger = logging.getLogger('deploy')
     rolist = DeployableObject.objects.filter(pending_stories__in=stories)
     deployResult = Deployment.deploy(set(rolist),
                                      from_branch,
                                      to_branch,
                                      testOnly=False,
                                      retain_package=True)
     if deployResult is not None:
         if not deployResult.success:
             for dm in deployResult.messages:
                 if not dm.success:
                     logger.info('fail: {0} - {1}'.format(
                         dm.fullName, dm.problem))
                 else:
                     logger.info('pass: {0}'.format(dm.fullName))
             raise CommandError('deployment failed')