From 874b871422fa465624d6854de017962c347f2274 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Mon, 13 Nov 2017 15:53:27 -0800 Subject: [PATCH] Updates for new CI --- circle.yml | 11 ---------- dactyl-config.yml | 2 ++ tool/all-target-link-checker.sh | 38 +++++++++++++++++++++++++++++++++ tool/conflictmarkers.sh | 14 ++++++++++++ tool/jenkins.sh | 8 +++++++ 5 files changed, 62 insertions(+), 11 deletions(-) delete mode 100644 circle.yml create mode 100755 tool/all-target-link-checker.sh create mode 100755 tool/conflictmarkers.sh create mode 100755 tool/jenkins.sh diff --git a/circle.yml b/circle.yml deleted file mode 100644 index c6cfd4a3e4..0000000000 --- a/circle.yml +++ /dev/null @@ -1,11 +0,0 @@ -general: - build_dir: ./ -dependencies: - pre: - - pyenv global 3.4.0 - override: - - pip3 install dactyl -test: - override: - - dactyl_build -s - - dactyl_link_checker diff --git a/dactyl-config.yml b/dactyl-config.yml index c935fdf8bd..a6f50fec7a 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -117,6 +117,8 @@ targets: - name: rippled-setup display_name: rippled Setup Guide + link_subs: + "reference-rippled.html": https://ripple.com/build/rippled-apis/ pages: # References are exhaustive lists of commands and options diff --git a/tool/all-target-link-checker.sh b/tool/all-target-link-checker.sh new file mode 100755 index 0000000000..055e3e783e --- /dev/null +++ b/tool/all-target-link-checker.sh @@ -0,0 +1,38 @@ +#!/bin/bash +mkdir -p out +## One-liner syntax doesn't handle exit codes properly... +#./build.sh -lq | awk '{print "rm -r out/ && ./build.sh -t "$1" && ./check-links.sh"}' | xargs -0 bash -c + +targets=`dactyl_build -lq | awk '{print $1}'` +linkerrors=0 +builderrors=0 +while read -r line; do + echo "" + echo "=======================================" + echo "Checking Target: $line" + rm -r out + dactyl_build -sq -t "$line" + buildresult=$? + if [ $buildresult -eq 0 ] + then + dactyl_link_checker -q "$@" + linkerrors=$(($? + $linkerrors)) + else + builderrors=$(($buildresult + $builderrors)) + echo "Error building this target; skipping link checker." + fi +done <<< "$targets" + +totalerrors=$(($builderrors + $linkerrors)) + +echo "" +echo "=======================================" +echo "=======================================" +echo "All-target summary:" +echo "• $builderrors build errors" +echo "• $linkerrors link errors" +echo "-----------------------------" +echo " $totalerrors total errors" +echo "" + +exit $totalerrors diff --git a/tool/conflictmarkers.sh b/tool/conflictmarkers.sh new file mode 100755 index 0000000000..f8baca1ced --- /dev/null +++ b/tool/conflictmarkers.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +PATTERNS=('<<<<<<<' '>>>>>>>') +#not including ====== because that can be used for markdown h1 syntax + +n=0 +for p in ${PATTERNS[@]}; do + g=`grep -R $p content/* | grep -v '^Binary file .* matches$'` + if [[ ! -z $g ]]; then + echo "Git merge conflict marker $p found: $g" + n=1 + fi +done +exit $n diff --git a/tool/jenkins.sh b/tool/jenkins.sh new file mode 100755 index 0000000000..c6010ebaeb --- /dev/null +++ b/tool/jenkins.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# meant to be run from the root directory of the repo + +set -e + +tool/conflictmarkers.sh +tool/all-target-link-checker.sh