Last active
August 8, 2018 22:59
-
-
Save eliranmal/85b924ab38bec6e59960fd3282c73679 to your computer and use it in GitHub Desktop.
periodically triggers teamcity builds. just stuff it in the dev console (but don't forget it running!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (triggerIntervalSeconds) { | |
triggerIntervalSeconds = triggerIntervalSeconds || (60 * 5); | |
var runInterval = triggerIntervalSeconds * 1000; | |
var runBuildTimeout = 300; | |
function runBuild(done) { | |
var runBtn = jQuery("button:contains(Run)")[0]; | |
console.log('opening build run dialog...'); | |
console.dirxml(runBtn); | |
runBtn.dispatchEvent(new Event('click')); | |
setTimeout(function () { | |
var releaseForm = document.querySelector('#runBuild'); | |
console.log('submitting build run...'); | |
console.dirxml(releaseForm); | |
releaseForm.dispatchEvent(new Event('submit')); | |
done(); | |
}, runBuildTimeout); | |
} | |
function task() { | |
setTimeout(function () { | |
runBuild(task); | |
}, runInterval); | |
} | |
task(); | |
})(/* triggerIntervalSeconds: number */); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
by the way, using this gist is a bad idea. don't do it.