1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

fix code climate issues

This commit is contained in:
Marcus Holl 2019-05-17 14:52:27 +02:00
parent d7d36c9445
commit a24c89ce12
4 changed files with 30 additions and 27 deletions

View File

@ -39,7 +39,7 @@ def resolvePlugin(call) {
for(def pd in pDescs) {
if(pd.getSymbol() == call)
return pd.real.plugin?.shortName
return pd.real.plugin?.shortName
}
return null
}

View File

@ -7,15 +7,15 @@ def stepPluginMapping = [:]
println "[INFO] Resolving plugins ..."
for(def step in stepCallMapping) {
def resolvedPlugins = [:]
for(def call in step.value) {
def resolvedPlugin = resolvePlugin(call)
if (! resolvedPlugin) resolvedPlugin = 'UNIDENTIFIED'
if(resolvedPlugins[resolvedPlugin] == null)
resolvedPlugins[resolvedPlugin] = (Set)[]
resolvedPlugins[resolvedPlugin] << call
stepPluginMapping.put(step.key,resolvedPlugins)
}
def resolvedPlugins = [:]
for(def call in step.value) {
def resolvedPlugin = resolvePlugin(call)
if (! resolvedPlugin) resolvedPlugin = 'UNIDENTIFIED'
if(resolvedPlugins[resolvedPlugin] == null)
resolvedPlugins[resolvedPlugin] = (Set)[]
resolvedPlugins[resolvedPlugin] << call
stepPluginMapping.put(step.key,resolvedPlugins)
}
}
def result = System.getenv()['result']
@ -35,8 +35,7 @@ def resolvePlugin(call) {
for(def pd in pDescs) {
if(pd.getSymbol() == call)
return pd.real.plugin?.shortName
return pd.real.plugin?.shortName
}
return null
}

View File

@ -5,26 +5,26 @@ groovy steps.groovy
[ -d jenkins_home ] && rm -rf jenkins_home
cp -r jenkins_home_init jenkins_home
cp -r jenkins_home_init jenkins_home
CALLS="`pwd`/jenkins_home/piper/calls.json"
CALLS="$(pwd)/jenkins_home/piper/calls.json"
mkdir -p `dirname ${CALLS}`
mkdir -p $(dirname "${CALLS}")
mv target/performedCalls.json ${CALLS}
mv target/performedCalls.json "${CALLS}"
[ -f ${CALLS} ] || { echo "File \"${CALLS}\" does not exist." ; exit 1; }
[ -f "${CALLS}" ] || { echo "File \"${CALLS}\" does not exist." ; exit 1; }
cID=$(docker run -d -v `pwd`/jenkins_home:/var/jenkins_home --env calls=/var/jenkins_home/piper/calls.json --env result=/var/jenkins_home/piper/result.json ppiper/jenkins-master);
echo "ContainerId: ${cID}";
cID="$(docker run -d -v `pwd`/jenkins_home:/var/jenkins_home --env calls=/var/jenkins_home/piper/calls.json --env result=/var/jenkins_home/piper/result.json ppiper/jenkins-master)"
echo "ContainerId: ${cID}"
while true
do
[ -f jenkins_home/piper/result.json ] && { docker rm -f ${cID}; break; } # normal ...
[ -f jenkins_home/piper/FAILURE ] && { docker rm -f ${cID}; break; } # executing of our init script failed
docker ps --no-trunc |grep -q ${cID} || break # docker container does not run anymore
[ -f jenkins_home/piper/result.json ] && { docker rm -f "${cID}"; break; } # normal ...
[ -f jenkins_home/piper/FAILURE ] && { docker rm -f "${cID}"; break; } # executing of our init script failed
docker ps --no-trunc |grep -q "${cID}"|| break # docker container does not run anymore
echo "[INFO] waiting for results"
sleep 10
done
RESULT="`pwd`/jenkins_home/piper/result.json"
[ -f ${RESULT} ] && cat jenkins_home/piper/result.json
RESULT="$(pwd)/jenkins_home/piper/result.json"
[ -f "${RESULT}" ] && cat jenkins_home/piper/result.json

View File

@ -42,7 +42,11 @@ while(counter < 1600) {
for (def calledStep in calledSteps) {
if (calledStep in Map) {
if(calledStep in Map) {
// After some time not working on this I have acually forgotten
// what needs to be done here ... In order not to forget that
// here is maybe something missing we emit a log message.
System.err << "[DEBUG] This is not handled yet.(${calledStep})\n"
} else {
if(calledStep in piperSteps) {
toBeReplaced = calledStep