This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NonCPS | |
def getKeys(map) { | |
def keylist = [] | |
for (def entry in map) { | |
// For converting map into list: | |
// // keylist.add(new java.util.AbstractMap.SimpleImmutableEntry(entry.key, entry.value)) | |
keylist.add(entry.key) | |
} | |
keylist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
fix() { | |
export lightsail_wordpress_fix=true ; | |
check ; | |
exit 0 ; | |
} | |
check() { | |
export checks_failed=0 ; | |
[[ $DEBUGN -lt 2 ]] || set -x ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
say_and_do() { | |
echo "$@" 1>&2 ; | |
"$@" ; | |
local e=$? ; | |
echo "Exit code = $e" 1>&2 ; | |
echo ; | |
return $e ; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
debug_linux() { | |
local this=debug_linux | |
local label=$1 ; | |
[[ $label ]] || label=0 ; | |
local outputfile=$2 ; | |
[[ $outputfile ]] || outputfile=$this.$label.txt ; | |
{ | |
echo $this ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
CLEAN = true | |
DEBUG = 2 | |
OVERALL_TIMEOUT = 1 // minutes | |
email_to = '[email protected], [email protected], ' | |
git_creds = 'general-deploy-key-1' | |
git_url = '[email protected]:someNamespace/someProject.git' | |
branch = '' | |
default_branch = 'master' // Ignored if Jenkinsfile is pulled from SCM - in favor of that Jenkinsfile's SCM branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isStringBlankOrNull(s) { | |
if ( s == null ) { | |
return true | |
} else if ( 0 == s.compareTo("") ) { | |
return true | |
} | |
return false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pre() { | |
local f=$1 ; | |
mkdir test_$f &> /dev/null ; | |
ln -s ../functions.sh test_$f/functions.sh ; | |
cat bash_script.sh.pre > test_$f/bash_script.sh | |
echo "$MAIN" >> test_$f/bash_script.sh ; | |
cat bash_script.sh.post >> test_$f/bash_script.sh | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat > functions.sh <<'EOF' | |
#!/bin/bash | |
die() { | |
local exit=$2 ; | |
echo "$exit" | egrep '^[0-9][0-9]*$' &> /dev/null || exit=1 ; | |
echo "$1" ; | |
exit $exit ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget_curl_file() { # Args: from_URL, to_file. Optional arg: Log. | |
local log='' ; | |
log=$3 ; | |
[[ $log ]] || log=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ; | |
{ wget -qO $2 $1 2>$log || curl -s $1 > $2 ; } &> $log ; | |
local e=$? | |
[[ $e -eq 0 ]] || { | |
echo "ERROR: $e from wget or curl:" 1>&2 |