Skip to content

Instantly share code, notes, and snippets.

@dalpert-korewireless
Last active April 9, 2021 18:34
Show Gist options
  • Select an option

  • Save dalpert-korewireless/679efc59f7880d7c1b83 to your computer and use it in GitHub Desktop.

Select an option

Save dalpert-korewireless/679efc59f7880d7c1b83 to your computer and use it in GitHub Desktop.
Tampermonkey script to add UI helpers for Octopus Deploy
// ==UserScript==
// @name Octopus Helpers
// @namespace http://blog.spinthemoose.com/
// @version 0.2
// @description Adds some useful capabilities to the Octopus Deploy UI.
// @author David Alpert
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match http://172.30.100.100/app*
// @grant none
// ==/UserScript==
function OctopusHelpers() {
if (window.jQuery == 'undefined') {
window.setTimeout(OctopusHelpers, 100);
} else {
var hash = location.hash.slice(1);
if (hash.endsWith('/releases/create')) {
var x = 'release-editor input[ng-model="release.Version"]';
waitForKeyElements(x,
function(){
$(x).after('<input id="octohelper-copy-release-version" type="button" value="Apply Release Version to Packages" style="margin-left:10px;">');
$('#octohelper-copy-release-version').click(function(ev) {
var releaseVersion = $(x).val();
var packageVersionInputs = $('release-editor input[ng-model="pack.SpecificVersion"]');
packageVersionInputs.val(releaseVersion);
packageVersionInputs.each(function(idx,el){
angular.element(el).triggerHandler('change');
});
});
},
true /* only once */
);
}
}
}
OctopusHelpers();
@rsinghsohal
Copy link

To make it usable for the new Octopus Server please update
// @match http:// */octopus/app
to
// @match http:// */app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment