mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix for deprecating packages (#23403)
* Fix for deprecating packages * fixed tabs * code review - added set -eo pipefail
This commit is contained in:
parent
67e45a1d43
commit
20246a31f3
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
PACKAGES=(ui toolkit data runtime e2e)
|
PACKAGES=(ui toolkit data runtime e2e)
|
||||||
|
|
||||||
@ -28,13 +29,9 @@ function unpublish_previous_canary () {
|
|||||||
echo "Unpublish @grafana/${PACKAGE}@${CURRENT_CANARY}"
|
echo "Unpublish @grafana/${PACKAGE}@${CURRENT_CANARY}"
|
||||||
npm unpublish "@grafana/${PACKAGE}@${CURRENT_CANARY}" || (
|
npm unpublish "@grafana/${PACKAGE}@${CURRENT_CANARY}" || (
|
||||||
# We want to deprecate here, rather than fail and return an non-0 exit code
|
# We want to deprecate here, rather than fail and return an non-0 exit code
|
||||||
npm deprecate \
|
echo "Unpublish unsucessful [$?]. Deprecating @grafana/${PACKAGE}@${CURRENT_CANARY}"
|
||||||
"@grafana/${PACKAGE}@${CURRENT_CANARY}" \
|
# But if this fails, return the error code
|
||||||
"Unpublish failed with [$?]. Deprecating \"@grafana/${PACKAGE}@${CURRENT_CANARY}\"" || (
|
npm deprecate "@grafana/${PACKAGE}@${CURRENT_CANARY}"
|
||||||
# Echoing a log message will ultimately change the error code, so save the error
|
|
||||||
# code and return it after printing an error log.
|
|
||||||
echo "Could not deprecate \"@grafana/${PACKAGE}@${CURRENT_CANARY}\". Received exit-code [$?]"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user