capture return code from lhci command and proceed
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Robert Kaussow 2020-07-17 10:21:55 +02:00
parent 473a2dfc7e
commit 4ff54ef5c9
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 22 additions and 15 deletions

View File

@ -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

View File

@ -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