Skip to content

Instantly share code, notes, and snippets.

View stephansnyt's full-sized avatar

stephan stachurski stephansnyt

View GitHub Profile
from datetime import datetime
from custom_metrics.helpers import get_total_time_dict_from_context, get_point_dict_from_context
from custom_metrics.helpers.stackdriver_metrics import create_descriptor, log_point
def monitor(operator_class, **kwargs):
# TODO: let's make monitor function accept a `metric_reporter`, which will handle logics performed in `get_labels_for_metric` and `get_labels_for_point`
# TODO: as well as formatting inputs for Stackdriver and any other potential integrations (can be done with bunch of Handler classes that gets injected into the metric_reporter)
google_project_name = kwargs.pop('google_project')

What if you wanted the value of a variable to depend on a host being in two (or more) groups?

This headers of this table represents a "type" of group, environment.

The column down the left side represents another "type" of group, region.

The values in the cell represent what a particular variable should equal.

. dev stg prd
---
pipeline:
step:
image: ses1984/drone-gke:83d8a36
kube_secrets:
secret_debug_secret: ${secret_debug_secret}
secrets:
- source: GOOGLE_CREDENTIALS_DEV
def doTheThing(Closure doMe) {
try {
return doMe()
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException fie) {
// this ambiguous condition means a user probably aborted
if (fie.causes.size() == 0) {
throw new UserInterruptedException(fie)
} else {
throw fie
}