Skip to content

Instantly share code, notes, and snippets.

@eliranmal
Last active August 8, 2018 22:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliranmal/85b924ab38bec6e59960fd3282c73679 to your computer and use it in GitHub Desktop.
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!)
(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
Copy link
Author

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