Skip to content

Commit

Permalink
ci: use same way in scripts to discover modified modules. (#318)
Browse files Browse the repository at this point in the history
Consider changes that modifies version of WC
  • Loading branch information
manolo committed Oct 27, 2020
1 parent 4390337 commit 44e473e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
7 changes: 6 additions & 1 deletion scripts/generateChangeLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ function parseLog(log) {
commit.skip = !commit.breaking && !/(feat|fix|perf)/.test(commit.type);
commit.isIncluded = !commit.skip;
commit.title += result[3];
if (commit.type == 'chore' && /Update.*(NpmPackages|Webjar)/i.test(commit.title)) {
commit.title = 'Increase Web-Component version';
commit.skip = false;
commit.isIncluded = true;
}
} else {
commit.title += line;
}
Expand Down Expand Up @@ -289,7 +294,7 @@ function getTickets(c) {
function logCommit(c, withComponents) {
let log = ' - ' + parseLinks(c.commit.substring(0, 7) + ' ' + c.title[0].toUpperCase() + c.title.slice(1));;
const tickets = getTickets(c);
tickets && (log += `. ${tickets}`);
tickets && (log += `. ${tickets}`);
if (compact) {
const components = getComponents(c);
components && (log += `. ${components}`);
Expand Down
1 change: 1 addition & 0 deletions scripts/mergeITs.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ async function createPom() {
tplJs.project.artifactId = ['vaadin-flow-components-integration-tests'];
tplJs.project.parent[0].artifactId = ['vaadin-flow-components'];
tplJs.project.parent[0].version = [version];
delete tplJs.project.version;
const tests = tplJs.project.build[0].plugins[0].plugin.find(p => p.artifactId[0] === 'maven-failsafe-plugin');
tests.configuration = [{excludes: [{exclude: exclude}]}]
if (!fs.existsSync(itFolder)) {
Expand Down
44 changes: 23 additions & 21 deletions scripts/prepareDeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,36 @@ setPomVersion flow $flow
## Compute modules to build and deploy
modules=`grep '<module>' pom.xml | grep parent | cut -d '>' -f2 | cut -d '<' -f1 | perl -pe 's,-flow-parent,,g'`

for i in $modules
do
modVersion=`getPlatformVersion $i`
setPomVersion $i $modVersion
done

[ "$versionBase" = 14.4 -o "$versionBase" = 17.0 ] && lastTag=`git tag | grep "^$versionBase" | head -1`
if [ -n "$lastTag" ]
if [ "$versionBase" = 14.4 -o "$versionBase" = 17.0 ]
then
shift
## allow setting modules to build from command line or via env var
[ -n "$modified" ] || modified=$*
## otherwise utilise git history to figure out modified modules
[ -n "$modified" ] || modified=`git diff --name-only $lastTag HEAD | grep '.java$' | cut -d "/" -f1 | grep parent | sort -u | perl -pe 's,-flow-parent,,g'`

[ -n "$modified" ] && modules="$modified"
echo "Increasing version of the modified modules since last release $lastTag"
for i in $modules
for i in $modules
do
modVersion=`getPlatformVersion $i`
nextVersion=`getNextVersion $modVersion`
[ "$modVersion" = "$nextVersion" ] && echo Error Increasing version && exit 1
setPomVersion $i $nextVersion
setPomVersion $i $modVersion
done
git pull origin $branch --tags --ff-only --quiet
lastTag=`git tag --merged $branch --sort=-committerdate | head -1`
if [ -n "$lastTag" ]
then
shift
## allow setting modules to build from command line or via env var
[ -n "$modified" ] || modified=$*
## otherwise utilise git history to figure out modified modules
[ -n "$modified" ] || modified=`git log $lastTag..HEAD --name-only | grep '^vaadin-.*-flow-parent' | egrep -v 'flow-demo|flow-integration-tests' | sed -e 's,-flow-parent.*,,g' | sort -u`
[ -n "$modified" ] && modules="$modified"
echo "Increasing version of the modified modules since last release $lastTag"
for i in $modules
do
modVersion=`getPlatformVersion $i`
nextVersion=`getNextVersion $modVersion`
[ "$modVersion" = "$nextVersion" ] && echo Error Increasing version && exit 1
setPomVersion $i $nextVersion
done
fi
fi

echo "Deploying "`echo $modules | wc -w`" Modules from branch=$branch to profile=$profile"
## '.' points to the root project, 'vaadin-flow-components-shared' has the dependencies for demo and tests
## '.' points to the root project, 'vaadin-flow-components-shared' has the dependencies for demo and tests
build=.,vaadin-flow-components-shared
for i in $modules
do
Expand Down

0 comments on commit 44e473e

Please sign in to comment.