mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
TBR: Fix tree breakage. Ken's commit added sudo calls to archive_build.sh.
This commit is contained in:
parent
428e195dbe
commit
b49136dc8a
@ -20,29 +20,27 @@ DEFAULT_FROM="${IMAGES_DIR}/$DEFAULT_BOARD/$(ls -t1 \
|
|||||||
$IMAGES_DIR/$DEFAULT_BOARD 2>&-| head -1)"
|
$IMAGES_DIR/$DEFAULT_BOARD 2>&-| head -1)"
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
DEFINE_boolean archive_debug $FLAGS_TRUE \
|
|
||||||
"Archive debug information for build"
|
|
||||||
DEFINE_string board "$DEFAULT_BOARD" \
|
DEFINE_string board "$DEFAULT_BOARD" \
|
||||||
"The board to build packages for."
|
"The board to build packages for."
|
||||||
DEFINE_string build_number "" \
|
|
||||||
"The build-bot build number (when called by buildbot only)." "b"
|
|
||||||
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
|
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
|
||||||
"The chroot of the build to archive."
|
"The chroot of the build to archive."
|
||||||
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
|
|
||||||
"Modify image for factory install purposes"
|
|
||||||
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
|
|
||||||
"Modify image for factory testing purposes"
|
|
||||||
DEFINE_string from "$DEFAULT_FROM" \
|
DEFINE_string from "$DEFAULT_FROM" \
|
||||||
"Directory to archive"
|
"Directory to archive"
|
||||||
|
DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
|
||||||
|
DEFINE_integer keep_max 0 "Maximum builds to keep in archive (0=all)"
|
||||||
|
DEFINE_string zipname "image.zip" "Name of zip file to create."
|
||||||
|
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
|
||||||
|
DEFINE_string build_number "" \
|
||||||
|
"The build-bot build number (when called by buildbot only)." "b"
|
||||||
|
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
|
||||||
|
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
|
||||||
|
"Modify image for factory testing purposes"
|
||||||
|
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
|
||||||
|
"Modify image for factory install purposes"
|
||||||
DEFINE_string gsutil "gsutil" \
|
DEFINE_string gsutil "gsutil" \
|
||||||
"Location of gsutil"
|
"Location of gsutil"
|
||||||
DEFINE_string gsutil_archive "" \
|
DEFINE_string gsutil_archive "" \
|
||||||
"Optional datastore archive location"
|
"Optional datastore archive location"
|
||||||
DEFINE_integer keep_max 0 "Maximum builds to keep in archive (0=all)"
|
|
||||||
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
|
|
||||||
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
|
|
||||||
DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
|
|
||||||
DEFINE_string zipname "image.zip" "Name of zip file to create."
|
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
@ -62,9 +60,6 @@ fi
|
|||||||
# Die on any errors.
|
# Die on any errors.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Extend sudo timeout since we need it later.
|
|
||||||
sudo -v
|
|
||||||
|
|
||||||
if [ -z $DEFAULT_USED ] && [ $FLAGS_test_mod -eq $FLAGS_TRUE ]
|
if [ -z $DEFAULT_USED ] && [ $FLAGS_test_mod -eq $FLAGS_TRUE ]
|
||||||
then
|
then
|
||||||
echo "test_mod requires that the default from path be used."
|
echo "test_mod requires that the default from path be used."
|
||||||
@ -192,7 +187,7 @@ then
|
|||||||
"${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \
|
"${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \
|
||||||
--output_tag "${HWQUAL_NAME}"
|
--output_tag "${HWQUAL_NAME}"
|
||||||
# Optionally archive with gsutil hwqual.
|
# Optionally archive with gsutil hwqual.
|
||||||
if [ "$FLAGS_gsutil_archive" != "" ]
|
if [ $FLAGS_gsutil_archive != "" ]
|
||||||
then
|
then
|
||||||
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
||||||
GS_HWQUAL_IN="${OUTDIR}/${HWQUAL_NAME}.tar.bz2"
|
GS_HWQUAL_IN="${OUTDIR}/${HWQUAL_NAME}.tar.bz2"
|
||||||
@ -202,19 +197,8 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ]
|
|
||||||
then
|
|
||||||
echo "Creating debug archive"
|
|
||||||
pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib"
|
|
||||||
sudo tar czf "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \
|
|
||||||
--exclude debug/tests debug
|
|
||||||
CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz"
|
|
||||||
sudo sh -c "${CMD}"
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Optionally archive to Google Storage for Developers.
|
# Optionally archive to Google Storage for Developers.
|
||||||
if [ "$FLAGS_gsutil_archive" != "" ]
|
if [ $FLAGS_gsutil_archive != "" ]
|
||||||
then
|
then
|
||||||
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
||||||
GS_ZIPFILE="${GS_OUTDIR}/${FLAGS_zipname}"
|
GS_ZIPFILE="${GS_OUTDIR}/${FLAGS_zipname}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user