Skip to content

Instantly share code, notes, and snippets.

View mkutz's full-sized avatar

Michael Kutz mkutz

View GitHub Profile
@mkutz
mkutz / mvn-clean-recursive
Created April 18, 2018 08:45
Bash script to execute mvn clean for all sub directories containing a pom.xml
#!/usr/bin/env bash
#
# executes mvn clean for all sub directories containing a pom.xml
#
find . -name "pom.xml" -exec mvn clean -f '{}' \;
@mkutz
mkutz / SwitchScriptedJenkinsfile.groovy
Created August 3, 2020 15:24
Jenkinsfile using script and switch/case to pick one of multiple steps to be executed
#!/usr/bin/env groovy
// see https://jenkins.io/doc/book/pipeline/syntax/
pipeline {
agent any
parameters {
booleanParam(name: "RELEASE", defaultValue: false)
choice(name: "DEPLOY_TO", choices: ["", "INT", "PRE", "PROD"])
@mkutz
mkutz / README_TEMPLATE.md
Last active March 23, 2023 18:46
A template for better README.md

{What is the name of this?}

{WHY whould the reader want to read on? WHAT can this do? What are its limits?}

Usage

{What is the MINIMUM I need to do to use this?}

@mkutz
mkutz / Jenkinsfile
Last active August 11, 2022 10:57
Configure a secret text credential in Jenkins using a post-initialization script (https://wiki.jenkins.io/display/JENKINS/Post-initialization+script)
pipeline {
agent any
environment {
SECRET_TEXT = credentials("my-secret-text-crendentials-id")
USERNAME_PASSWORD = credentials("my-username-password-crendentials-id")
}
stages {
@mkutz
mkutz / Jenkinsfile
Created November 12, 2018 15:48
Configure JDK installations in Jenkins using a post-initialization script (https://wiki.jenkins.io/display/JENKINS/Post-initialization+script)
pipeline {
agent any
tools {
jdk "11"
}
stages {
stage("Use maven") {
@mkutz
mkutz / spring-boot-gradle-build.yml
Last active October 15, 2021 14:50
Simple build for a Spring Boot project built with Gradle
name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main
@mkutz
mkutz / build.yml
Last active October 15, 2021 13:06
Build and reused deployment GitHub workflow
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
@mkutz
mkutz / Jenkinsfile
Last active June 8, 2021 17:21
Configure global libraries in Jenkins (see https://jenkins.io/doc/book/pipeline/shared-libraries/) using a post-initialization script (see https://wiki.jenkins.io/display/JENKINS/Post-initialization+script)
@Library("my-other-jenkins-lib@other-version") _
pipeline {
agent any
environment {
SECRET_TEXT = credentials("googleChatWebhookCommonSystemTestsStatus")
}
@mkutz
mkutz / AvoiceElementClickInterceptedException.java
Created March 26, 2021 15:57
Selenium Silver Bullet: Clickin on Things Evnetually
new WebDriverWait(webDriver, 4)
.ignoring(ElementClickInterceptedException.class, ElementNotInteractableException.class)
.until(driver -> {
final var button = driver.findElement(By.className("button");
button.click();
return button;
});
@mkutz
mkutz / IfDeclarativeJenkinsfile.groovy
Last active August 3, 2020 15:26
Jenkinsfile using when to create an optional stage
#!/usr/bin/env groovy
// see https://jenkins.io/doc/book/pipeline/syntax/
pipeline {
agent any
parameters {
booleanParam(name: "RELEASE", defaultValue: false)
}