Commit 4296ae8f authored by Johan Helsing's avatar Johan Helsing

Initial commit

parents
module.exports = {
"extends": "standard"
};
\ No newline at end of file
node_modules
# QtWayland gerrit watcher
Watches for gerrit changes and starts a container if it's a QtWayland change
$ npm install
$ npm start
This diff is collapsed.
{
"name": "gerrit-watcher",
"version": "1.0.0",
"description": "Watches for gerrit patchsets and starts docker containers",
"author": "Johan Klokkhammer Helsing <johan.helsing@qt.io",
"license": "ISC",
"devDependencies": {
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1"
},
"dependencies": {
"gerrit-event-emitter": "^0.1.5"
}
}
const GerritEventEmitter = require('gerrit-event-emitter').GerritEventEmitter;
const emitter = new GerritEventEmitter('codereview.qt-project.org', 29418);
const { exec } = require("child_process");
emitter.on('patchsetCreated', function(data) {
const { change, patchSet } = data;
const { owner, project, subject } = change;
if (project !== 'qt/qtwayland') {
return;
}
console.log(`Detected new patch set in ${project} by ${owner}: ${subject}`);
const qtWaylandRev = patchSet.revision;
const command = `docker run -e QT_DOCKERTEST_QTWAYLAND_REF=${qtWaylandRev} qtbuilder-stretch`;
console.log(`Starting test "${command}"`);
exec(command, (err, stdout, stderr) => {
console.log('Testing finished');
console.log(err ? 'Failure :(' : 'Great success :D');
});
});
emitter.start();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment