Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Weingardt thomasweingardt

View GitHub Profile
View low_level_functions.groovy
@Library('gcx@v1.0') _
agent('android') {
stage("checkout") {
gitCheckout()
}
stage("build release") {
android.gradle "assembleRelease"
}
View high_level_functions.groovy
@Library('gcx@v1.0') _
def config = ios.appConfig([
projectFile : 'example.xcodeproj',
sourceDir : 'exampleDir',
testScheme : 'exampleScheme',
configuration : 'Debug',
language : 'swift',
simulatorOs : '12.x',
labelsForBuild : 'xcode',
@thomasweingardt
thomasweingardt / ping.groovy
Created Jan 9, 2019
Used in Medium article
View ping.groovy
def call(Closure body) {
echo "Ping!"
body()
}
@thomasweingardt
thomasweingardt / closure.groovy
Last active Jan 18, 2020
Used in Medium article
View closure.groovy
@Library('gcx@v1.0') _
ping {
echo "Pong!"
}
@thomasweingardt
thomasweingardt / hello.groovy
Last active Jan 9, 2019
Used in Medium article
View hello.groovy
def call(String name = 'world') {
echo "Hello, ${name}!"
}
@thomasweingardt
thomasweingardt / custom_step.groovy
Last active Jan 18, 2020
Used in Medium article
View custom_step.groovy
@Library('gcx@v1.0') _
hello()
hello 'medium'
@thomasweingardt
thomasweingardt / log.groovy
Last active Jan 9, 2019
Used in Medium article
View log.groovy
def info(message) {
echo "Info: ${message}"
}
def error(message) {
echo "Error: ${message}"
}
View global_variables.groovy
@Library('gcx@v1.0') _
log.info 'Hello'
log.error 'World'
View shared_library_simple.groovy
@Library('gcx@v1.0') _
doSomething()
@thomasweingardt
thomasweingardt / stages.groovy
Last active Jan 18, 2020
Used in Medium article
View stages.groovy
node('anyNodeName') {
stage('Build') {
echo 'Building...'
sh 'make'
}
stage('Test') {
echo 'Testing...'
sh 'make check || true'
junit '**/target/*.xml'
}