Example #1
0
def get_hotfix_detail(request, id):
    hotfix = hotfixs_helper.get(request, id)
    deploy = deploys_helper.get(request, hotfix['baseDeployId'])
    build = builds_helper.get_build(request, deploy['buildId'])
    urlPattern = systems_helper.get_url_pattern(request)
    commits = []
    _create_commits(commits, urlPattern['template'], hotfix)
    jenkins_url = "%s/%s/%s" % (BUILD_URL, hotfix['jobName'],
                                hotfix['jobNum']) if hotfix['jobName'] and hotfix['jobNum'] else ''
    html = render_to_string('hotfixs/hotfix_detail.tmpl', {
        "hotfix": hotfix,
        "commits": commits,
        "deploy": deploy,
        "build": build,
        "jenkins_url": jenkins_url
    })
    return HttpResponse(html)
Example #2
0
def get_hotfix(request, name, stage, id):
    env = environs_helper.get_env_by_stage(request, name, stage)
    hotfix = hotfixs_helper.get(request, id)
    deploy = deploys_helper.get(request, hotfix['baseDeployId'])
    build = builds_helper.get_build(request, deploy['buildId'])
    urlPattern = systems_helper.get_url_pattern(request)
    commits = []
    _create_commits(commits, urlPattern['template'], hotfix)
    jenkins_url = "%s/%s/%s" % (BUILD_URL, hotfix['jobName'],
                                hotfix['jobNum']) if hotfix['jobName'] and hotfix['jobNum'] else ''
    return render(request, 'hotfixs/hotfix_detail.html', {
        "env": env,
        "hotfix": hotfix,
        "commits": commits,
        "deploy": deploy,
        "build": build,
        "jenkins_url": jenkins_url
    })
Example #3
0
def get_hotfix_detail(request, id):
    hotfix = hotfixs_helper.get(request, id)
    deploy = deploys_helper.get(request, hotfix['baseDeployId'])
    build = builds_helper.get_build(request, deploy['buildId'])
    urlPattern = systems_helper.get_url_pattern(request)
    commits = []
    _create_commits(commits, urlPattern['template'], hotfix)
    jenkins_url = "%s/%s/%s" % (
        BUILD_URL, hotfix['jobName'],
        hotfix['jobNum']) if hotfix['jobName'] and hotfix['jobNum'] else ''
    html = render_to_string(
        'hotfixs/hotfix_detail.tmpl', {
            "hotfix": hotfix,
            "commits": commits,
            "deploy": deploy,
            "build": build,
            "jenkins_url": jenkins_url
        })
    return HttpResponse(html)
Example #4
0
    def get(self, request, name, stage):
        env = environs_helper.get_env_by_stage(request, name, stage)
        index = int(request.GET.get('page_index', '1'))
        size = int(request.GET.get('page_size', DEFAULT_PAGE_SIZE))
        hotfixes = hotfixs_helper.get_all(request, name, index, size)
        urlPattern = systems_helper.get_url_pattern(request)
        for hotfix in hotfixes:
            commits = []
            _create_commits(commits, urlPattern['template'], hotfix)
            hotfix["commits"] = commits

        return render(request, 'hotfixs/hotfix_landing.html', {
            "env": env,
            "hotfixes": hotfixes,
            "pageIndex": index,
            "pageSize": DEFAULT_PAGE_SIZE,
            "disablePrevious": index <= 1,
            "disableNext": len(hotfixes) < DEFAULT_PAGE_SIZE,
        })
Example #5
0
def get_hotfix(request, name, stage, id):
    env = environs_helper.get_env_by_stage(request, name, stage)
    hotfix = hotfixs_helper.get(request, id)
    deploy = deploys_helper.get(request, hotfix['baseDeployId'])
    build = builds_helper.get_build(request, deploy['buildId'])
    urlPattern = systems_helper.get_url_pattern(request)
    commits = []
    _create_commits(commits, urlPattern['template'], hotfix)
    jenkins_url = "%s/%s/%s" % (
        BUILD_URL, hotfix['jobName'],
        hotfix['jobNum']) if hotfix['jobName'] and hotfix['jobNum'] else ''
    return render(
        request, 'hotfixs/hotfix_detail.html', {
            "env": env,
            "hotfix": hotfix,
            "commits": commits,
            "deploy": deploy,
            "build": build,
            "jenkins_url": jenkins_url
        })
Example #6
0
    def get(self, request, name, stage):
        env = environs_helper.get_env_by_stage(request, name, stage)
        index = int(request.GET.get('page_index', '1'))
        size = int(request.GET.get('page_size', DEFAULT_PAGE_SIZE))
        hotfixes = hotfixs_helper.get_all(request, name, index, size)
        urlPattern = systems_helper.get_url_pattern(request)
        for hotfix in hotfixes:
            commits = []
            _create_commits(commits, urlPattern['template'], hotfix)
            hotfix["commits"] = commits

        return render(
            request, 'hotfixs/hotfix_landing.html', {
                "env": env,
                "hotfixes": hotfixes,
                "pageIndex": index,
                "pageSize": DEFAULT_PAGE_SIZE,
                "disablePrevious": index <= 1,
                "disableNext": len(hotfixes) < DEFAULT_PAGE_SIZE,
            })