We have a custom script that log it progress so we can track where it is.
All the echo are show in the terminal only after the script complete it execution.
here si the changelog
<changeSet id="changesetID" author="user">
<executeCommand executable="${project.build.directory}/classes/changelogs/init/scriptMySql" os="Linux">
<arg value="someparam"/>
</executeCommand>
</changeSet>
here is the logic of the bash script.
#!/bin/bash
nbFile=0
for SQLFile in ${1}/*.sql; do
nbFile=$((nbFile+1))
done
noFile=1
for SQLFile in ${1}/*.sql; do
percent=$(printf '%i %i' $noFile $nbFile | awk '{ pc=100*$1/$2; i=int(pc); print (pc-i<0.5)?i:i+1 }')
echo "File to manage : $SQLFile ($noFile / $nbFile --> $percent%)"
// manage the file in the folder.
noFile=$((noFile+1))
done
echo "end"
So when we do the script we expect that it log each time it start a new file but the log all append after the execution.
All the echo are show in the terminal only after the script complete it execution.
here si the changelog
<changeSet id="changesetID" author="user">
<executeCommand executable="${project.build.directory}/classes/changelogs/init/scriptMySql" os="Linux">
<arg value="someparam"/>
</executeCommand>
</changeSet>
here is the logic of the bash script.
#!/bin/bash
nbFile=0
for SQLFile in ${1}/*.sql; do
nbFile=$((nbFile+1))
done
noFile=1
for SQLFile in ${1}/*.sql; do
percent=$(printf '%i %i' $noFile $nbFile | awk '{ pc=100*$1/$2; i=int(pc); print (pc-i<0.5)?i:i+1 }')
echo "File to manage : $SQLFile ($noFile / $nbFile --> $percent%)"
// manage the file in the folder.
noFile=$((noFile+1))
done
echo "end"
So when we do the script we expect that it log each time it start a new file but the log all append after the execution.