diff --git a/release_dashboard/static/release_dashboard/js/hotfix.js b/release_dashboard/static/release_dashboard/js/hotfix.js index b7e7620..dfce7cd 100644 --- a/release_dashboard/static/release_dashboard/js/hotfix.js +++ b/release_dashboard/static/release_dashboard/js/hotfix.js @@ -11,6 +11,7 @@ $( "button.hotfix" ).click( function( e ) { var branch = $( "select#version_" + id + " option:selected" ).val().replace( "branch/", "" ); var repo = id; var span = $( "span#hotfix_error_" + id ); + var links = $( "#links_" + id ); var push = $( "select#push_" + id + " option:selected" ).val(); var empty = $( "input#empty_" + id ).prop( "checked" ); @@ -29,10 +30,13 @@ $( "button.hotfix" ).click( function( e ) { button.attr( "disabled", "disabled" ); span.html( "processing" ); span.show(); + links.addClass( "hidden" ); function successFunc( data, _status ) { span.html( "" ); - span.append( "Done" ); + $( "#link_done_" + id ).attr( "href", data.urls[ 0 ] ); + $( "#link_latest_" + id ).attr( "href", data.urls[ 1 ] ); + links.removeClass( "hidden" ); button.removeAttr( "disabled" ); } @@ -47,6 +51,7 @@ $( "td.version > select" ).change( function() { var version = $( this ).val(); var button = $( "button#hotfix_" + id ); var span = $( "span#hotfix_error_" + id ); + var links = $( "#links_" + id ); if ( version.match( /^branch\/mr[0-9]+\.[0-9]+\.[0-9]+$/ ) ) { button.html( "Release hotfix" ); @@ -56,6 +61,7 @@ $( "td.version > select" ).change( function() { button.attr( "disabled", "disabled" ); } span.html( "" ); + links.addClass( "hidden" ); } ); $( document ).ready( function() { diff --git a/release_dashboard/templates/release_dashboard/hotfix.html b/release_dashboard/templates/release_dashboard/hotfix.html index d799a2d..859b716 100644 --- a/release_dashboard/templates/release_dashboard/hotfix.html +++ b/release_dashboard/templates/release_dashboard/hotfix.html @@ -48,6 +48,14 @@ + {% endfor %} diff --git a/release_dashboard/utils/build.py b/release_dashboard/utils/build.py index 8976a0e..e196883 100644 --- a/release_dashboard/utils/build.py +++ b/release_dashboard/utils/build.py @@ -69,7 +69,11 @@ def trigger_hotfix(project, branch, user, push="yes", empty=False): logger.warn("Debug mode, would trigger: %s", url) else: open_jenkins_url(url) - return "%s/job/release-tools-runner/" % settings.JENKINS_URL + res = [ + "{}/job/release-tools-runner/".format(settings.JENKINS_URL), + "/panel/release-{}-update/{}/latest/".format(branch, project), + ] + return res def trigger_build( diff --git a/release_dashboard/views/build.py b/release_dashboard/views/build.py index 105cad9..a39fb24 100644 --- a/release_dashboard/views/build.py +++ b/release_dashboard/views/build.py @@ -108,8 +108,8 @@ def hotfix_build(request, branch, project): empty = json_data.get("empty", False) if push == "no": logger.warn("dryrun for %s:%s", project, branch) - url = build.trigger_hotfix(project, branch, request.user, push, empty) - return JsonResponse({"url": url}) + urls = build.trigger_hotfix(project, branch, request.user, push, empty) + return JsonResponse({"urls": urls}) def _build_logic(form, projects):