Jelajahi Sumber

[CI] error the build if we fail to push to haxe-output.

Andy Li 9 tahun lalu
induk
melakukan
c778ef7a01
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      tests/RunCi.hx

+ 5 - 1
tests/RunCi.hx

@@ -672,9 +672,10 @@ class RunCi {
 		}
 
 		// try save() for 5 times because the push may fail when the another build push at the same time
+		var pushResult = null;
 		for (i in 0...5) {
 			save();
-			var pushResult = commandResult("git", ["push", "origin", haxe_output_branch]);
+			pushResult = commandResult("git", ["push", "origin", haxe_output_branch]);
 			if (pushResult.exitCode == 0) {
 				successMsg("push to haxe-output succeed");
 				break;
@@ -687,6 +688,9 @@ class RunCi {
 				Sys.sleep(Std.random(10));
 			}
 		}
+		if (pushResult.exitCode != 0) {
+			Sys.exit(1);
+		}
 	}
 
 	static function main():Void {