Skip to content

Instantly share code, notes, and snippets.

@gsemet
gsemet / gist:7000717
Last active December 25, 2015 15:49 — forked from wcargen/gist:7000672
Schema Lab Problem 3
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
import logging
import os
from twisted.internet import defer
from buildbot.schedulers.triggerable import Triggerable
from buildbot.status.results import EXCEPTION
from buildbot.status.results import FAILURE
from buildbot.status.results import SKIPPED
from buildbot.status.results import SUCCESS
class TriggerSample(SimpleTriggerStep):
descriptionSkipped = "nothing configured"
def addRuntimeSchedulerNames(self):
a_list = ...
autoemr = ['triggerable-{}-mergerequest'.format(a) for a in a_list]
return autoemr
def postExecute(self, res):
# renderables ('Agreation' solution)
@any_kind_of_decorator_to_declare_a_renderable_pre_init
def commandRenderable1(prop):
# A renderable cannot access to the self of a step, since it is evaluated before the actual initialization. So it cannot change the "self" state, and cannot add step logs
...
a = prop.getProperty('aproperty')
...
return the_actual_commands_to_add
@gsemet
gsemet / renderable_example1.py
Created January 31, 2015 18:09
Test Gist Plugin
def command(self):
# not the same signature than the renderable, but same name.
# it has the self so can change the state of the step directly even if it is not advises.
# it can add logs
...
a = self.getProperty('aproperty')
self.addLogStdio("I can describe what I will do since I have self").
self.some_variable = some_value
...
return the_actual_commands_to_add
We couldn’t find that file to show.
@gsemet
gsemet / etc_nut_notifycmd
Last active May 31, 2017 07:50
NUT notification to PushOver
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
from pushover import init
from pushover import Client
USER_KEY = "xxxxxxxxxxxxxxxx"
@gsemet
gsemet / marathon_jupyter_config.json
Last active June 8, 2017 14:58
Jupyter Test Deployment Configuration on Marathon
{
"id": "/jupyter",
"cmd": "start-notebook.sh --NotebookApp.token=''",
"cpus": 25,
"mem": 70000,
"disk": 1000,
"instances": 1,
"acceptedResourceRoles": [
"*"
],