capture return code from lhci command and proceed
This commit is contained in:
parent
473a2dfc7e
commit
4ff54ef5c9
@ -1,3 +1,2 @@
|
|||||||
- ENHANCEMENT
|
- BUGFIX
|
||||||
- remove `LHCI_REPO_NAME`, could be handled within the CI
|
- capture return code from lhci command and proceed with post-processing
|
||||||
- fix `PATH` order to force use wrapper scripts as default
|
|
||||||
|
@ -3,7 +3,7 @@ set -eo pipefail
|
|||||||
|
|
||||||
CONFIG="${LHCI_BASE_DIR%/}/.lighthouserc.yml"
|
CONFIG="${LHCI_BASE_DIR%/}/.lighthouserc.yml"
|
||||||
|
|
||||||
/usr/local/bin/lhci "$@"
|
/usr/local/bin/lhci "$@" || ERROR=true
|
||||||
|
|
||||||
if [ -f "$CONFIG" ]; then
|
if [ -f "$CONFIG" ]; then
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ if [ -f "$CONFIG" ]; then
|
|||||||
DIST="${LHCI_BASE_DIR%/}/${UPLOAD_OUTPUT_DIR%/}/dist"
|
DIST="${LHCI_BASE_DIR%/}/${UPLOAD_OUTPUT_DIR%/}/dist"
|
||||||
mkdir -p "${DIST}"
|
mkdir -p "${DIST}"
|
||||||
|
|
||||||
|
if [ -f "$CONFIG" ]; then
|
||||||
printf "\nPost-process report files...\n"
|
printf "\nPost-process report files...\n"
|
||||||
for ITEM in $(jq -r '.[] | select( .isRepresentativeRun == true ) | @base64' < "${MANIFEST}"); do
|
for ITEM in $(jq -r '.[] | select( .isRepresentativeRun == true ) | @base64' < "${MANIFEST}"); do
|
||||||
JSON=$(echo "${ITEM}" | base64 -d)
|
JSON=$(echo "${ITEM}" | base64 -d)
|
||||||
@ -28,5 +29,12 @@ if [ -f "$CONFIG" ]; then
|
|||||||
cp "${FILENAME}" "${DIST}/${FILENAME_NEW}.html"
|
cp "${FILENAME}" "${DIST}/${FILENAME_NEW}.html"
|
||||||
echo "Report for ${URL} will be uploaded to ${LHCI_SERVER_URL%/}/$(basename "${FILENAME_NEW}").html"
|
echo "Report for ${URL} will be uploaded to ${LHCI_SERVER_URL%/}/$(basename "${FILENAME_NEW}").html"
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
printf "\nPost-processing skipped. Manifest not found!\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$ERROR" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user