Skip to content

Handle delete-only case in dbbBuild.sh #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions Templates/Common-Backend-Scripts/dbbBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ propOverrides="" # Override of default build parameters for zAppBuild
outDir="" # Computed output directory to store build protocols
nestedApplicationFolder="" # Flag to understand a nested repository

LastBuildLog=""
buildlistsize=0
# Local variables for checking the contents of buildList and deletedFilesList
totalLogListSize=0
buildListFile=""
deletedFilesListFile=""

DBBLogger=""
zAppBuildVerbose=""
Expand Down Expand Up @@ -503,26 +505,24 @@ if [ $rc -eq 0 ]; then

## Except for the reset mode, check for "nothing to build" condition and throw an error to stop pipeline
if [ "$Type" != "--reset" ]; then

# Locate the most recent Build Log Directory within outDir. The Build Log Directories are Time Stamped.
# Therefore, the last directory entry will be the most recent Build Log. The directory will always be
# be created by DBB, but "buildList.txt" may not. If not created, array will will be blank.
array=$(find ${outDir} -name "buildList.txt")
for log in ${array[@]}; do
LastBuildLog=${log}
echo $PGM": [INFO] LastBuildLog = ${LastBuildLog}"

# Locate buildList and deletedFilesList in Build Log Directory within outDir, and group them in logListArray
buildListFile="${outDir}/buildList.txt"
deletedFilesListFile="${outDir}/deletedFilesList.txt"
logListArray=(${buildListFile} ${deletedFilesListFile})

# For each list in logListArray, if found in the last Build Log Directory, get its size (character count), then
# increase logListSize by that amount.
for list in ${logListArray[@]}; do
if [ -f ${list} ]; then
# wc -c will return the two values; Character Count and Log File Path. Parse out the Character Count.
set $(wc -c <${list})
totalLogListSize=$((${totalLogListSize}+$1))
fi
done

# If "buildList.txt" was found in the last Build Log Directory, determine the character count.
# wc -c will return the two values; Character Count and Log File Path. Parse out the Character Count.
if [ -z ${LastBuildLog} ]; then
buildlistsize=0
else
set $(wc -c <${LastBuildLog})
buildlistsize=$1
fi

if [ $buildlistsize = 0 ]; then
# Error/warning if both build and file list have 0 character count (i.e. are empty)
if [ ${totalLogListSize} = 0 ]; then
rc=4
ERRMSG=$PGM": [WARNING] DBB Build Error. No source changes detected. rc="$rc
echo $ERRMSG
Expand Down