Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
periodically triggers teamcity builds. just stuff it in the dev console (but don't forget it running!)
(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 */);
@eliranmal

This comment has been minimized.

Copy link
Owner Author

commented Mar 20, 2017

by the way, using this gist is a bad idea. don't do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.