Testing lerna on circle

This commit is contained in:
Dominik Prokop
2019-07-11 13:00:58 +02:00
parent 7ec87ee76b
commit c74c7e24e2
2 changed files with 61 additions and 0 deletions
+17
View File
@@ -623,6 +623,19 @@ jobs:
echo "-- no changes to docs files --"
fi
release-packages-nightly:
docker:
- image: circleci/node:10
steps:
- checkout
- run:
name: yarn install lerna
command: 'yarn install lerna'
no_output_timeout: 15m
- run:
name: prepare bumped versions
command: './scripts/circle-check-packages.sh'
workflows:
version: 2
build-master:
@@ -803,3 +816,7 @@ workflows:
- postgres-integration-test
- cache-server-test
filters: *filter-not-release-or-master
- release-packages-nightly:
filters: *filter-not-release-or-master
requires:
- test-frontend
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
#!/bin/bash
# function exit_if_fail {
# command=$@
# echo "Executing '$command'"
# eval $command
# rc=$?
# if [ $rc -ne 0 ]; then
# echo "'$command' returned $rc."
# exit $rc
# fi
# }
# npm install lerna
# count=0
# rc=$?
function parse_git_hash() {
git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/"
}
#Get current version from lerna.json
PACKAGE_VERSION=`grep '"version"' lerna.json | cut -d '"' -f 4`
# Get short current commit's has
GIT_BRANCH=$(parse_git_hash)
echo "Commit: ${GIT_BRANCH}"
echo "Current lerna.json version: ${PACKAGE_VERSION}"
# count packages that changed
count=`lerna changed --loglevel silent | awk '{c++} END {print c}'`
if [ -z $count ]; then
echo "No changes in packages, not publishing"
else
echo "Changes detected in ${count} packages"
echo "Releasing packages under ${PACKAGE_VERSION}-${GIT_BRANCH}"
lerna version ${PACKAGE_VERSION}-${GIT_BRANCH} --no-git-tag-version --no-push --force-publish -y
git status -s
fi