Use the Jenkins-style DEB output path and fix the copy to the packages-out mount
- Document --package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/"
(Jenkins convention) in the usage examples
- The in-container copy step now copies to the real mount point
/workspace/packages-out instead of ${PACKAGE_OUTPUT_DIR}, which is a host
path that does not exist inside the container (the copy was a silent
no-op; packages reached the host directly via make_rpm's
--output_dir /workspace/rpms/... on the workspace mount)
- Skip the copy when the host output directory is the same directory as
make_rpm's output dir (stat device:inode guard) - which is exactly the
case for the Jenkins-style path above, where make_rpm already writes the
packages in place
This commit is contained in:
1 parent
5c012ba228
commit
bf3fecf5c0
1 file changed
+17
-7
@@ -68,7 +68,8 @@ Examples:
|
||||
./new_docker_build.sh --docker-image legatus-qt6:1.0
|
||||
./new_docker_build.sh --delete-prebuilt-image --docker-image legatus-qt6:1.0
|
||||
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
|
||||
--run-jenkins-builder --package-output-dir /path/to/rpms/guez/26.04
|
||||
--run-jenkins-builder \
|
||||
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/"
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -428,7 +429,6 @@ RELEASE_BUILD="${RELEASE_BUILD:-ON}"
|
||||
RUN_CTEST="${RUN_CTEST:-ON}"
|
||||
# Packaging variables
|
||||
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
||||
PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR:-/workspace/packages-out}"
|
||||
LTS_VERSION="${LTS_VERSION:-1.0}"
|
||||
PROJECT="${PROJECT:-guez}"
|
||||
GUEZ_MODE="${GUEZ_MODE:-ON}"
|
||||
@@ -534,16 +534,26 @@ if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy produced DEB packages to the packages-out mount so they are
|
||||
# Copy produced DEB packages to the packages-out mount (host:
|
||||
# ${PACKAGE_OUTPUT_DIR}, container: /workspace/packages-out) so they are
|
||||
# available on the host after the container exits.
|
||||
mkdir -p "${PACKAGE_OUTPUT_DIR}"
|
||||
# make_rpm already writes to /workspace/rpms/... (the host workspace
|
||||
# mount), so when the host's PACKAGE_OUTPUT_DIR is that same directory
|
||||
# the packages are already in place - skip copying onto themselves.
|
||||
DEST_DIR=/workspace/packages-out
|
||||
mkdir -p "${DEST_DIR}"
|
||||
shopt -s nullglob
|
||||
for deb in "/workspace/rpms/${PROJECT}/${OS_VERSION}/"*.deb; do
|
||||
cp -f "${deb}" "${PACKAGE_OUTPUT_DIR}/"
|
||||
base="$(basename "${deb}")"
|
||||
if [[ -e "${DEST_DIR}/${base}" ]] &&
|
||||
[[ "$(stat -c '%d:%i' "${deb}")" == "$(stat -c '%d:%i' "${DEST_DIR}/${base}")" ]]; then
|
||||
continue
|
||||
fi
|
||||
cp -f "${deb}" "${DEST_DIR}/"
|
||||
done
|
||||
shopt -u nullglob
|
||||
log_info "DEB packages copied to ${PACKAGE_OUTPUT_DIR}:"
|
||||
ls -lh "${PACKAGE_OUTPUT_DIR}/"
|
||||
log_info "DEB packages available in ${DEST_DIR} (host: ${PACKAGE_OUTPUT_DIR:-unknown}):"
|
||||
ls -lh "${DEST_DIR}/"
|
||||
else
|
||||
log_info "Skipping DEB package production"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user