From 19d63ad72c012ee3dfb9375724067b278593df8a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 01:35:10 -0500 Subject: try building only keyboards needed --- util/travis_build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 util/travis_build.sh (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh new file mode 100644 index 000000000..df2e06960 --- /dev/null +++ b/util/travis_build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" +TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" + +if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then + NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | wc -l) + if [[ $NEFM -gt 0 ]] ; then + echo "Making all keymaps for all keyboards" + make all-keyboards AUTOGEN=true + else + MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z_]+)' | sort -u) + for KB in $MKB ; do + echo "Making all keymaps for $KB" + make "$KB" AUTOGEN=true + done + fi +fi -- cgit v1.2.3-24-g4f1b From 6a92cc28977ff4d51fa0bafcb757867b27ebdb45 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 02:00:07 -0500 Subject: correctly assign bash variable --- util/travis_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh index df2e06960..38c1ffc65 100644 --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -7,12 +7,12 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | wc -l) if [[ $NEFM -gt 0 ]] ; then echo "Making all keymaps for all keyboards" - make all-keyboards AUTOGEN=true + make all-keyboards AUTOGEN="true" else MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z_]+)' | sort -u) for KB in $MKB ; do echo "Making all keymaps for $KB" - make "$KB" AUTOGEN=true + make "$KB" AUTOGEN="true" done fi fi -- cgit v1.2.3-24-g4f1b From 616b8604b0b0f7e281ecfeff385d96a6a14955da Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 11:53:43 -0500 Subject: variable scope fix for travis --- util/travis_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh index 38c1ffc65..fab9178de 100644 --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -12,7 +12,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z_]+)' | sort -u) for KB in $MKB ; do echo "Making all keymaps for $KB" - make "$KB" AUTOGEN="true" + make "$KB" AUTOGEN=true done fi fi -- cgit v1.2.3-24-g4f1b From de659486f52db6492be6ca03ce5450690f5d891d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 12:36:25 -0500 Subject: pass through travis errors --- util/travis_build.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh index fab9178de..794b0d3a1 100644 --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -4,15 +4,19 @@ TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then + exit_code=0 NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | wc -l) if [[ $NEFM -gt 0 ]] ; then echo "Making all keymaps for all keyboards" make all-keyboards AUTOGEN="true" + : $((exit_code = $exit_code + $?)) else MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z_]+)' | sort -u) for KB in $MKB ; do echo "Making all keymaps for $KB" make "$KB" AUTOGEN=true + : $((exit_code = $exit_code + $?)) done fi + exit $exit_code fi -- cgit v1.2.3-24-g4f1b From ad1327cd003ac25f7ee1b6f404d01139e0f5be88 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 7 Feb 2017 20:51:50 -0500 Subject: accept numbers in travis build --- util/travis_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh index 794b0d3a1..2d43f3e5e 100644 --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -11,7 +11,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then make all-keyboards AUTOGEN="true" : $((exit_code = $exit_code + $?)) else - MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z_]+)' | sort -u) + MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_]+)' | sort -u) for KB in $MKB ; do echo "Making all keymaps for $KB" make "$KB" AUTOGEN=true -- cgit v1.2.3-24-g4f1b From bfc33a56d7f69d1e75d72d88a6df3fdc16f3dafb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 11 Feb 2017 11:39:57 -0500 Subject: don't try to build the readme --- util/travis_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/travis_build.sh') diff --git a/util/travis_build.sh b/util/travis_build.sh index 2d43f3e5e..6bafd1941 100644 --- a/util/travis_build.sh +++ b/util/travis_build.sh @@ -11,7 +11,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then make all-keyboards AUTOGEN="true" : $((exit_code = $exit_code + $?)) else - MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_]+)' | sort -u) + MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_]+)(?=\/)' | sort -u) for KB in $MKB ; do echo "Making all keymaps for $KB" make "$KB" AUTOGEN=true -- cgit v1.2.3-24-g4f1b