Skip to content

Instantly share code, notes, and snippets.


Michael Sauter michaelsauter

View GitHub Profile

✂️ Get rid of that boilerplate!


def final projectId = 'foo'
def final componentId = 'bar'
def final credentialsId = "${projectId}-cd-cd-user-with-password"
def dockerRegistry
node {
  dockerRegistry = env.DOCKER_REGISTRY
View Jenkinsfile.example
imageStreamTag: 'ods/jenkins-agent-base:3.x'
) {
odsComponentStageImportOpenShiftImageOrElse(context) {
stage('Build') {
sh './gradlew build'
View gist:16bd497a2052b014f31fb40da8ad33d7
import org.ods.service.ServiceRegistry
import org.ods.util.GitUtil
import org.ods.util.Project
def runOnAgentPod(Project project, boolean condition, Closure block) {
if (condition) {
def git = ServiceRegistry.instance.get(GitUtil)
dir(env.WORKSPACE) {
stash(name: 'wholeWorkspace', includes: '**/*,**/.git', useDefaultExcludes: false)

Work Packages for OpenDevStack 3.0

Release timeline: May 2020. Theme: Quality

Shared Library Testing

Owner(s): ? / Size: M / Benefit: Reliable pipelines, more confidence in changes / Ticket(s): #149, #146

Write automated tests for the shared library. Could be a mixed of tests with mocks and E2E tests. Run e.g. in Travis or Github Actions.

Project Provisioning Testing


Interview Task


As a Farmera developer, synchronize temperature data reliably from an external vendor,, with Farmera. What kind of concepts / entities do you need to implement in our service? How will you do the interaction with If you need more information about the API, please ask.

API Documentation

Example request

curl '' -i -u 'user:secret' -X GET
michaelsauter / gist:297c0a67ba277b9c508f933ef9f70cdf
Last active Jan 31, 2017
Find and remove old Git branches
View gist:297c0a67ba277b9c508f933ef9f70cdf
# Update local repo
git fetch origin --prune
# Merged branches at least 2 months old
for branch in `git branch -r --merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | grep "months" | awk '{print $(NF)}' | sed -e "s/^origin\///" | xargs git push origin --delete --dry-run
# All branches at least a year old
for branch in `git branch -r | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | grep "1 year" | awk '{print $(NF)}' | sed -e "s/^origin\///" | xargs git push origin --delete --dry-run
michaelsauter / Makefile
Created Jan 23, 2017
Terraform Makefile
View Makefile
@terraform version | grep "Terraform v0\.8\.[0-9]*" >/dev/null; case $$? in \
1) echo You need Terraform version 0.8.x!; exit 1;; \
config: check
@terraform remote config -backend=s3 -backend-config="bucket=xxx-terraform-state" -backend-config="key=yyy/terraform.tfstate" -backend-config="region=eu-central-1"
plan: config
@terraform plan -out terraform.tfplan

Encrypt file:

gpg --encrypt --armor --recipient file

Decrypt file:

gpg --decrypt file
View Vagrantfile
Vagrant.require_version ">= 1.6.3"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "boot2docker" = "yungsang/boot2docker"
config.vm.box_check_update = false
You can’t perform that action at this time.