fix(common): build check failed

Build check was failing due to parse issues with
using sed to parse json. Went the jq route. Adding
to this PR because this PR had the issue...
This commit is contained in:
Marc Durdin 2020-03-18 14:55:37 +11:00
parent 359003928a
commit e33f24cd36
3 changed files with 88 additions and 4 deletions

View file

@ -0,0 +1,70 @@
jq is copyright (C) 2012 Stephen Dolan
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
jq's documentation (everything found under the docs/ subdirectory in
the source tree) is licensed under the Creative Commons CC BY 3.0
license, which can be found at:
https://creativecommons.org/licenses/by/3.0/
The documentation website includes a copy of Twitter's Boostrap and
relies on Bonsai, Liquid templates and various other projects, look
them up for detailed licensing conditions.
jq incorporates David M. Gay's dtoa.c and g_fmt.c, which bear the
following notices:
dtoa.c:
The author of this software is David M. Gay.
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
purpose without fee is hereby granted, provided that this entire notice
is included in all copies of any software which is or includes a copy
or modification of this software and in all copies of the supporting
documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
g_fmt.c:
The author of this software is David M. Gay.
Copyright (c) 1991, 1996 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
purpose without fee is hereby granted, provided that this entire notice
is included in all copies of any software which is or includes a copy
or modification of this software and in all copies of the supporting
documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.

Binary file not shown.

View file

@ -17,6 +17,11 @@ else
PRNUM="$1"
fi
function debug_echo() {
#echo "DEBUG: $1"
true
}
#
# This must be run under a TeamCity environment in order to receive all variables
#
@ -42,7 +47,7 @@ function triggerTestBuilds() {
local force="${3:-false}"
for platform in "${platforms[@]}"; do
echo "# $platform: changes detected"
echo "# $platform: checking for changes"
eval test_builds='(${'bc_test_$platform'[@]})'
for test_build in "${test_builds[@]}"; do
if [[ $test_build == "" ]]; then continue; fi
@ -77,12 +82,18 @@ fi
# targeted by the PR other than to ask GitHub, anyway.)
#
# For now, this script runs only on Windows agents. In the future we
# may need to make this a little more platform-agnostic
JQ="$(dirname "$THIS_SCRIPT")/jq-win64.exe"
echo ". Get information about pull request #$PRNUM from GitHub"
prinfo=`curl -s -H "User-Agent: @keymanapp" https://api.github.com/repos/keymanapp/keyman/pulls/$PRNUM`
prbase=`echo ${prinfo} | sed -E 's/.+"base".+"ref":"([^"]+)".+/\1/'`
prhead=`echo ${prinfo} | sed -E 's/.+"head".+"ref":"([^"]+)".+"base".+"ref":.+/\1/'`
prbase=`echo ${prinfo} | "$JQ" -r '.base.ref'`
prhead=`echo ${prinfo} | "$JQ" -r '.head.ref'`
#debug: echo "Base of $PRNUM ($prhead) is $prbase"
debug_echo "PRNUM: $PRNUM"
debug_echo "BASE: $prbase"
debug_echo "HEAD: $prhead"
#
# By default, TeamCity does not fetch any remote branch information
@ -107,6 +118,8 @@ if [ "$prfiles" == "abort" ]; then
exit 0
fi
debug_echo "Files found: ${prfiles[*]}"
popd > /dev/null
#
@ -132,6 +145,7 @@ while IFS= read -r line; do
done
done <<< "$prfiles"
debug_echo "Build platforms: ${build_platforms[*]}"
#
# Start the test builds
#