Skip to content
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
25 changes: 21 additions & 4 deletions build-scripts/prepare-results
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
#!/bin/sh

. "$(dirname "$0")"/functions
. detect-environment
# Prepare build artifacts and test results for collection/archival.
# This script collects built packages and test results from various locations
# and copies them to a single output directory ($OUTDIR) for easy retrieval.

# Source required configuration and utility files
. "$(dirname "$0")"/functions # $OUTDIR, $BASEDIR
. detect-environment # $PACKAGING
. compile-options
. version

set -x
log_debug "--- Preparing build results and test artifacts ---"
log_debug "Output directory: $OUTDIR"
log_debug "Packaging format: $PACKAGING"

# Create output directory if it doesn't exist
mkdir -p "$OUTDIR"
Comment thread
larsewi marked this conversation as resolved.

# Collect built packages from each CFEngine edition directory
# Iterates through community, nova (enterprise agent), and nova-hub directories
for dir in cfengine-community cfengine-nova cfengine-nova-hub; do
if [ -d "$BASEDIR"/$dir ]; then
log_debug "Collecting packages from $dir"
# Copy packages based on platform-specific packaging format
case "$PACKAGING" in
rpm)
cp "$BASEDIR"/$dir/RPMS/*/*.rpm "$OUTDIR"
Expand All @@ -37,18 +49,23 @@ for dir in cfengine-community cfengine-nova cfengine-nova-hub; do
cp "$HOME"/lppdir/out/*.bff "$OUTDIR"
;;
*)
echo "Unknown packaging system: $PACKAGING"
log_error "Unknown packaging system: $PACKAGING"
exit 1
;;
esac
#cp $BASEDIR/$dir/*.generic-pkg.tar.gz "$OUTDIR"
fi
done

# Collect test results from each tested project
# projects_to_test returns the list of projects that should be tested (defined in functions) based on $PROJECT (community/nova) and $ROLE (agent/hub)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

for project in $(projects_to_test); do
if [ -f "$BASEDIR"/"$project"/tests/acceptance/summary.log ]; then
log_debug "Collecting test results from $project"
cp "$BASEDIR"/"$project"/tests/acceptance/summary.log "$OUTDIR"/"$project"-summary.log
cp "$BASEDIR"/"$project"/tests/acceptance/test.log "$OUTDIR"/"$project"-test.log
cp "$BASEDIR"/"$project"/tests/acceptance/test.xml "$OUTDIR"/"$project"-test.xml
fi
done

log_debug "--- Build results preparation complete ---"
Loading