This file contains 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
# STRING operations | |
# trim string = strip() | |
gav=gavString.strip().split(':') | |
# create types | |
retValue = {} | |
retValue = [] | |
# length | |
i = len(retValue) |
This file contains 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
dsh ls /etc/bashrc | perl -ne 'BEGIN { printf "export ss=\${1};shift;export args=\$@;" }{ $_=~s/://g;@x=split /\s+/;printf "ssh -t %s \"echo \${ss} | sudo -S -u tibcosilver \${args} \"\n",$x[0], $x[2]}' | tee out | |
perl -i -pe "s/#/'/g" out | |
echo "Please run: . out [Password]" | |
Will generate something like this: | |
ssh -t vangrant1.com "echo ${ss} | sudo -S -u appuser ${args} " | |
ssh -t vangrant2.com "echo ${ss} | sudo -S -u appuser ${args} " | |
Then can be used like this |
This file contains 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
// Make release branch: | |
git checkout -b release-1.0 | |
// Set release version: | |
mvn versions:set -DnewVersion=1.0 | |
mvn versions:commit | |
// Push changes to release branch: | |
git add . | |
git commit -m "Set release version to 1.0" |
This file contains 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 props = [] | |
if (config.enableReleaseControl) { | |
props.add( | |
[ | |
$class: 'ParametersDefinitionProperty', parameterDefinitions: [ | |
[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Perform release cut (1.0.0-SNAPSHOT to 1.0.0.1)', name : 'PERFORM_RELEASE_CUT'], | |
[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Perform incremental versioning from (1.0.0-SNAPSHOT to 1.0.1) mostly done after a sprint completion or demo', name : 'INCREMENTAL_VERSIONING'], | |
[$class: 'StringParameterDefinition', defaultValue: '', description: 'Placeholder for explicit release tag for manual assignment', name: 'RELEASE_TAG'] | |
] |
This file contains 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
// | |
echo "STEPS : ${STEPS}" | |
//echo "name : ${name}" | |
def streets = ['STREET_1','STREET_2','STREET_3'] | |
def execution_map = [:] | |
for (int j=0; j < streets.size(); j++) { | |
for (int i=0; i < STEPS.length; i++) { | |
if ( streets[j] == STEPS[i].BUILD_STREET ) { | |
if (execution_map.get(streets[j]) == null) { | |
execution_map.put(streets[j], []) |
This file contains 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
node { | |
echo 'Hello World' | |
// [Pipeline] echo | |
//here the steps : [SEFS_TEST_JUNIT_MODEL; | |
// BUILD_TEST_GOAL=org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject@1b3cff4[ShipmentEFS/SEFS_COMMON-6270/PARENT_POM], SEFS_TEST_JUNIT_MODEL; | |
// BUILD_TEST_GOAL=org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject@16d92a30[ShipmentEFS/SEFS_COMMON-6270/ASRI]] | |
echo "here the steps : ${STEPS}" | |
for (int i=0; i < STEPS.length; i++) { | |
echo "${STEPS[i]}" |
This file contains 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/groovy | |
@Library('libz') _ | |
echo ">>>Setting Up Scheduling<<<<" | |
properties( | |
[ | |
pipelineTriggers([ | |
triggers: [ |
This file contains 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
import groovy.json.JsonSlurperClassic | |
@NonCPS | |
def jsonParse(def json) { | |
new groovy.json.JsonSlurperClassic().parseText(json) | |
} | |
node('master') { | |
def config = jsonParse(readFile("config.json")) |
This file contains 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
node { | |
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'mylogin', | |
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { | |
sh ''' | |
set +x | |
curl -u $USERNAME:$PASSWORD https://private.server/ > output | |
''' | |
} | |
} |
This file contains 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
// Change `url` value to your own | |
def inputParams=new URL('http://maven.com/sefs/sefs-scm.txt').text | |
// Change `message` value to the message you want to display | |
// Change `description` value to the description you want | |
def selectedProperty = input( id: 'userInput', message: 'Choose properties file', | |
parameters: [ [ | |
$class: 'ChoiceParameterDefinition', | |
choices: inputParams, | |
description: 'Properties', |
NewerOlder