Today I finally took the time to put up a live demo website for Hesperides!
https://hesperides.herokuapp.com
Hesperides is an open source tool dedicated to configuration management: it stores applications properties and mustache templates for configurations files. It is strongly hierarchized based on few main concepts: modules, applications …
I took me some time to figure it out, so I'm sharing this here:
import hudson.EnvVars
import org.jenkinsci.plugins.workflow.steps.EnvironmentExpander
def env = EnvironmentExpander.getEffectiveEnvironment(new EnvVars(), null, steps.getContext(EnvironmentExpander.class), null, null)
def ansiColorEnabled = 'TERM' in env
At work, we needed to retrieve the full list of jobs a given Jenkins instance was hosting.
Our first solution was to use the jenkinsapi Python package:
import xml.etree.ElementTree as XmlElementTree
from jenkinsapi.jenkins import Jenkins
def get_all_jenkins_jobs(server_url):
jenkins = Jenkins(server_url, lazy=True, timeout=30,
username=os …
Recently I lost a lot of time on this. Hence I want to share a working solution, even if i cannot take the time to detail the issue.
I'm taking about writing reusable code for Jenkinsfiles : https://jenkins.io/doc/book/pipeline/shared-libraries/
One cannot simply use Groovy HTTPBuilder
, because …
...in just one command :
cd path/to/your/git/repo
cat <<EOF >.git/hooks/pre-rebase
#!/bin/sh
echo -n \$'\x1b[36m' # start coloration (cyan)
curl -s https://raw.githubusercontent.com/jenkinsci/chucknorris-plugin/master/src/main/java/hudson/plugins/chucknorris/FactGenerator.java | sed '1,/FACTS = {/d;s/^ \+"//;s/"..\?$//;/^$/,$d …