@ -6,17 +6,6 @@ PACKAGES=(ui toolkit data runtime e2e e2e-selectors)
# shellcheck source=./scripts/helpers/exit-if-fail.sh
source " $( dirname " $0 " ) /helpers/exit-if-fail.sh "
function parse_git_hash( ) {
git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/"
}
function prepare_version_commit ( ) {
echo $'\nCommitting version changes. This commit will not be checked-in!'
git config --global user.email "drone@grafana.com"
git config --global user.name "Drone"
git commit -am "Version commit"
}
function unpublish_previous_canary ( ) {
_package = $1
echo $'\nUnpublishing previous canary packages'
@ -38,14 +27,6 @@ function unpublish_previous_canary () {
fi
}
# Get current version from lerna.json
PACKAGE_VERSION = $( grep '"version"' lerna.json | cut -d '"' -f 4)
# Get current commit's short hash
GIT_SHA = $( parse_git_hash)
echo " Commit: ${ GIT_SHA } "
echo " Current lerna.json version: ${ PACKAGE_VERSION } "
# check if there were any changes to packages between current and previous commit
count = $( git diff HEAD~1..HEAD --name-only -- packages | awk '{c++} END {print c}' )
count = "1"
@ -53,14 +34,12 @@ if [ -z "$count" ]; then
echo "No changes in packages, skipping packages publishing"
else
echo " Changes detected in ${ count } packages "
echo " Releasing packages under ${ PACKAGE_VERSION } - ${ GIT_SHA } "
./node_modules/.bin/lerna version " ${ PACKAGE_VERSION } - ${ GIT_SHA } " --exact --no-git-tag-version --no-push --force-publish -y
echo $'\nGit status:'
git status -s
prepare_version_commit
echo "Starting to release latest canary version"
echo $'\nBuilding packages'
# Frontend packages have already been versioned and built by the
# build-frontend step in drone. We will only unpublish the previous
# canary version and publish the current built version as the new
# latest canary build.
for PACKAGE in " ${ PACKAGES [@] } "
do