|
|
@ -3,7 +3,7 @@ const remoteExec = require('./remoteExec.js');
|
|
|
|
const sdk = require('matrix-js-sdk');
|
|
|
|
const sdk = require('matrix-js-sdk');
|
|
|
|
const yaml = require('js-yaml');
|
|
|
|
const yaml = require('js-yaml');
|
|
|
|
|
|
|
|
|
|
|
|
const config = yaml.safeLoad(fs.readFileSync('config.yaml'));
|
|
|
|
global.config = yaml.safeLoad(fs.readFileSync('config.yaml'));
|
|
|
|
const matrixClient = sdk.createClient({
|
|
|
|
const matrixClient = sdk.createClient({
|
|
|
|
baseUrl: config.matrix.baseurl,
|
|
|
|
baseUrl: config.matrix.baseurl,
|
|
|
|
accessToken: config.matrix.accesstoken,
|
|
|
|
accessToken: config.matrix.accesstoken,
|
|
|
@ -35,7 +35,7 @@ commands['rebuild'].exec = function(args, room, event) {
|
|
|
|
|
|
|
|
|
|
|
|
matrixClient.sendNotice(room.roomId, 'rebuilding container ' + container);
|
|
|
|
matrixClient.sendNotice(room.roomId, 'rebuilding container ' + container);
|
|
|
|
|
|
|
|
|
|
|
|
remoteExec('./rebuild.sh ' + container, config)
|
|
|
|
remoteExec('./rebuild.sh ' + container)
|
|
|
|
.then(function(result) {
|
|
|
|
.then(function(result) {
|
|
|
|
matrixClient.sendNotice(room.roomId, event.sender.userId + '\nrebuilt container ' + container);
|
|
|
|
matrixClient.sendNotice(room.roomId, event.sender.userId + '\nrebuilt container ' + container);
|
|
|
|
}, function(result) {
|
|
|
|
}, function(result) {
|
|
|
|