Skip to content

Instantly share code, notes, and snippets.

View logan-barnett-nwea's full-sized avatar

logan-barnett-nwea

View GitHub Profile
@mucst
mucst / log-to-console-from-shared-lib-class.groovy
Last active August 23, 2024 18:43
How to println to console log from jenkins shared library class
/*
* If you develop a jenkins shared library, you might eventually face the issue described at:
* https://stackoverflow.com/questions/47320406/propagating-logs-in-shared-library-to-jenkins-job-console
*
* Many across the internet suggest to pass the "steps" object to the class as some (constructor) parameter, such as in
* https://www.jenkins.io/doc/book/pipeline/shared-libraries/#accessing-steps
*
* ... which works, however this might be difficult if there are many usages of the class where you "just" want to print something to
* the console, maybe just for some debugging purposes. Unfortunatelly standard java Logger (in the momemnt of writing this gist at least)
* does not work. A not so nice, however working solution can be the following.
@chromy
chromy / update_avatar.sh
Created June 25, 2013 17:32
A bash scrip to get your Gravatar and save it as an image and a favicon.
#!/bin/bash
# This script downloads a gravatar image associated with EMAIL and saves it at
# AVATAR_OUTPUT_PATH then creates a favicon icon and saves it at
# FAVICON_OUTPUT_PATH.
EMAIL="[email protected]"
AVATAR_OUTPUT_PATH="static/img/avatar.png"
FAVICON_OUTPUT_PATH="static/favicon.ico"