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
npm install -g aws-cdk | |
cdk --version |
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
let AWS = require('aws-sdk'); | |
let ec2 = new AWS.EC2(); | |
let ecs = new AWS.ECS(); | |
let route53 = new AWS.Route53(); | |
/** | |
* expects an environment variable with name "entryparam" and the following value / structure: | |
* [{ | |
* "cluster": "mycluster1", | |
* "domain": "demo.mydomain.com", |
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
// cron = 55 4 * * 3 | |
module['exports'] = function techhour(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
var channel = "general"; | |
var request = require('request'); | |
var store = hook.datastore; | |
var keyName = hook.params.hook+"-lastRunDateMillis"; | |
// disable date compare | |
store.del(keyName, function() {}); |
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
module['exports'] = function warningday(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
var channel = "general"; | |
var request = require('request'); | |
var store = hook.datastore; | |
var keyName = hook.params.hook+"-lastRunDateMillis"; | |
// disable date compare | |
store.del(keyName, function() {}); |
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
module['exports'] = function icb2reminder(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
var channel = "general"; | |
var request = require('request'); | |
var jsonRequest = jsonRequest = createJson("#"+channel, "Nicht vergessen...", "", | |
"Das ICB Meeting (Teil 2) steht in 5 Minuten an.", "Das ICB Meeting (Teil 2) steht in 5 Minuten an!", | |
hook.env.PICTURE_BASE_URL + "/icblogo.png"); | |
var resp = request( |
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
module['exports'] = function trashreminder(hook) { | |
// run 0 4 * * 3 | |
console.log("Starting Hook: "+hook.params.hook); | |
//console.log("hook.params.ranFromCron: "+hook.params.ranFromCron); | |
var channel = "general"; | |
var request = require('request'); | |
var message = "everyone Reminder: Wer mit dem Mülldienst dran ist, muss heute (Mittwoch) den Mülleimer in der Küche leeren."; | |
var resp = request( | |
{ |
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
module['exports'] = function icb1reminder(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
var channel = "general"; | |
var request = require('request'); | |
var jsonRequest = jsonRequest = createJson("#"+channel, "Nicht vergessen...", "", | |
"Das ICB Meeting (Teil 1) steht in 5 Minuten an.", "Das ICB Meeting (Teil 1) steht in 5 Minuten an!", | |
hook.env.PICTURE_BASE_URL + "/icblogo.png"); | |
var resp = request( |
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
module['exports'] = function gapassthrough(hook) { | |
var request = require('request'); | |
console.log("Starting Hook: "+hook.params.hook); | |
// console.log(body) // Show the HTML for the Google homepage. | |
var jsonRequest = createJson(body); | |
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
module['exports'] = function weather(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
var request = require('request'); | |
var store = hook.datastore; | |
var url = "http://api.openweathermap.org/data/2.5/find?q=Osnabrueck&units=metric&lang=de"; | |
var keyName = hook.params.hook+"-lastRunDateMillis"; | |
store.get(keyName, function(error, result) { | |
if(error) { | |
hook.res.end("Fucked up :"+error.message); |
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
module['exports'] = function codebase(hook) { | |
console.log("Starting Hook: "+hook.params.hook); | |
// hook.io has a range of node modules available - see https://hook.io/modules. | |
// We use request (https://www.npmjs.com/package/request) for an easy HTTP request | |
var request = require('request'); | |
var payload = JSON.parse(hook.req.body.payload); | |
var title; | |
var jsonRequest; |