Browse Source

Add more shiny logging

Tianon Gravi 11 years ago
parent
commit
74ffdec38b
1 changed files with 8 additions and 7 deletions
  1. 8 7
      bashbrew/build.sh

+ 8 - 7
bashbrew/build.sh

@@ -196,12 +196,16 @@ while [ "$#" -gt 0 ]; do
 	
 	echo "Processing $repoTag ..."
 	
+	thisLog="$logDir/build-$repoTag.log"
+	touch "$thisLog"
+	ln -sf "$thisLog" "$latestLogDir/$(basename "$thisLog")"
+	
 	if ! ( cd "$gitRepo" && git rev-parse --verify "${gitRef}^{commit}" &> /dev/null ); then
 		echo "- skip; invalid ref: $gitRef"
 		continue
 	fi
 	
-	( cd "$gitRepo" && git clean -dfxq && git checkout -q "$gitRef" )
+	( set -x; cd "$gitRepo" && git clean -dfxq && git checkout -q "$gitRef" ) &>> "$thisLog"
 	# TODO git tag
 	
 	IFS=$'\n'
@@ -220,15 +224,12 @@ while [ "$#" -gt 0 ]; do
 	done
 	
 	if [ "$doBuild" ]; then
-		( cd "$gitRepo/$gitDir" && "$dir/git-set-dir-times" )
+		( set -x; cd "$gitRepo/$gitDir" && "$dir/git-set-dir-times" ) &>> "$thisLog"
 		
-		thisLog="$logDir/build-$repoTag.log"
-		touch "$thisLog"
-		ln -sf "$thisLog" "$latestLogDir/$(basename "$thisLog")"
-		docker build -t "$repoTag" "$gitRepo/$gitDir" &> "$thisLog"
+		( set -x; docker build -t "$repoTag" "$gitRepo/$gitDir" ) &>> "$thisLog"
 		
 		for namespace in $namespaces; do
-			docker tag "$repoTag" "$namespace/$repoTag"
+			( set -x; docker tag "$repoTag" "$namespace/$repoTag" ) &>> "$thisLog"
 		done
 	fi
 done