Skip to content

Instantly share code, notes, and snippets.

@k8scat
k8scat / extract-credentials.groovy
Created April 13, 2021 08:22 — forked from pedrohdz/extract-credentials.groovy
Export credentials for Jenkins Configuration as Code (JCasC)
// This Jenkins Groovy script extracts credentials in Jenkins and outputs them
// in a JSON format that can be digested by "Jenkins Configuration as Code".
// Just pass the output into a JSON to YAML converter. You can run this
// through the Jenkins Script Console or similar.
//
// Thank you:
// - https://github.com/tkrzeminski/jenkins-groovy-scripts/blob/master/show-all-credentials.groovy
//
// To conver to YAML `json2yaml | sed '/^[[:space:]]*$/d'`
//
@k8scat
k8scat / generate_cert.sh
Last active April 9, 2021 16:11
Generate letsencrypt certs via certbot in docker with pre_hook and post_hook.
#!/bin/bash
set -e
domain=$1
email=$2
pre_hook=$3
post_hook=$4
if [[ -z "${domain}" || -z "${email}" ]]; then
echo "usage: $0 <domain> <email> [pre_hook] [post_hook]"
exit 1