feature/21176 #1

Merged
roberto.cirillo merged 10 commits from feature/21176 into master 2021-11-18 16:15:02 +01:00
1 changed files with 1 additions and 51 deletions
Showing only changes of commit eebdae5529 - Show all commits

52
Jenkinsfile vendored
View File

@ -188,61 +188,11 @@ def printReport(report) {
}
manuele.simi marked this conversation as resolved
Review

You don't need the shebang here.

You don't need the shebang here.
Review

Are you referring to the bash shell?

I've used the bash shell otherwise the echo -e option doesn't work.

Is there an easier way to do that?

Are you referring to the bash shell? I've used the bash shell otherwise the `echo -e` option doesn't work. Is there an easier way to do that?
Review

echo (without -e) works for sure without the shebang.

But if it does work for you, leave like that. It's a detail.

`echo` (without -e) works for sure without the shebang. But if it does work for you, leave like that. It's a detail.
Review

echo (without -e) works for sure without the shebang.

But if it does work for you, leave like that. It's a detail.

Yes it works but without the "-e" option the backslashes are not escapes. The result is an unreadable file.

> `echo` (without -e) works for sure without the shebang. > > But if it does work for you, leave like that. It's a detail. > Yes it works but without the "-e" option the backslashes are not escapes. The result is an unreadable file.
def appendNotes(report) {
sh("""
sh("""#!/bin/bash
echo -e "${report}" > $WALKER_NOTES
""")
}
// print the final report
def saveReport(report) {
def text = ''
def indent = '\t'
sh("""
echo "Dependency Report for ${report['project']}" > $WALKER_NOTES
echo "\n\n" >> $WALKER_NOTES
echo "|--Project Maven Modules " >> $WALKER_NOTES
""")
report['downstream_modules'].each { depth, artifacts ->
artifacts.each { name, data ->
sh("""
echo "${indent}|--Module: ${name}\n" >> $WALKER_NOTES
echo "${indent * 2}|--Deepest Dependency Level: ${depth}\n" >> $WALKER_NOTES
echo "${indent * 2}|--Used by (Maven Modules)\n" >> $WALKER_NOTES
""")
data['dependencies'].each { d ->
sh("""
echo "${indent * 3}|--${d}" >> $WALKER_NOTES
echo "\n" >> $WALKER_NOTES
""")
}
sh("""
echo "${indent * 2}|--Referred by (Jenkins Projects)\n" >> $WALKER_NOTES
""")
data['projects'].each { p ->
sh("""
echo "${indent * 3}|--${p}" >> $WALKER_NOTES
echo "\n" >> $WALKER_NOTES
""")
}
}
}
sh("""
echo "\n\n" >> $WALKER_NOTES
echo "|--All Downstream Projects\n" >> $WALKER_NOTES
""")
report['downstream_projects'].unique().sort()
report['downstream_projects'].each { p ->
sh("""
echo "${indent}|--${p}" >> $WALKER_NOTES
echo "\n" >> $WALKER_NOTES
""")
}
}
// debug job
def printJob(job) {
println("fullname ${job.fullName}")