Skip to content

Commit 2f7ea82

Browse files
authored
Merge pull request #594 from boozallen/591-improve-arch-test
[#591] fix tty error in CI
2 parents 9349a45 + 8b228d8 commit 2f7ea82

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

foundation/foundation-archetype/test-project-archetype.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ function runBuildAndUpdateDeploy {
7979
outputstart='executions to test-generator-deploy'
8080
outputend='\[WARNING\]'
8181
# $outputstart match at end ensures the match line isn't captured. NF ensures blank lines aren't captured.
82-
execs=$(./mvnw clean install | tee /dev/tty | \
83-
awk "BEGIN {output=0} /$outputend/ {output=0} NF && output {print} /$outputstart/ {output=1}")\
84-
|| { echo -e '\n\n\t**** MAVEN BUILD FAILED ****\n\n' ; exit 1; }
82+
./mvnw clean install | \
83+
tee >(awk "BEGIN {output=0} /$outputend/ {output=0} NF && output {print} /$outputstart/ {output=1}">tmp.out ) \
84+
|| { echo -e '\n\n\t**** MAVEN BUILD FAILED ****\n\n' ; exit 1; }
85+
execs=$(cat tmp.out)
86+
rm -f tmp.out
8587
if [ -n "$execs" ]; then
8688
#re-adding insert comment allows for subsequent insertions
8789
execs=$deployInsert$'\n'$execs
@@ -278,7 +280,7 @@ sub "s/ *<\/plugins>/$plugins <\/plugins>/" test-generator-deploy/pom.xml
278280

279281
echo -e "\nINFO: Running full build to check that the build passes w/o any manual actions needed\n"
280282
# NOTE: because fermenter results are cached, the build-cache will hide remaining manual actions that were missed in previous steps
281-
./mvnw clean install -Dmaven.build.cache.skipCache -Dfermenter.display.message.keys=true | tee /dev/tty | awk '/WARNING/ {print}' > maven-build.log \
283+
./mvnw clean install -Dmaven.build.cache.skipCache -Dfermenter.display.message.keys=true | tee >(awk '/WARNING/ {print}' > maven-build.log) \
282284
|| { echo -e '\n\n\t**** MAVEN BUILD FAILED ****\n\n' ; exit 1; }
283285
if grep -iq 'Manual action' maven-build.log; then
284286
echo -e "\n\n **** ERROR: Manual action still found in build **** \n Look at **archetype/target/temp/test-generator/maven-build.log** to see what the problem was. \n\n"

0 commit comments

Comments
 (0)