From a14b35ca6c8b387f5c94442502ea2fa88a410aa2 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Thu, 12 Mar 2015 15:55:22 -0700 Subject: [PATCH] Skip credentials prompt for CI builds --- makefile.shade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/makefile.shade b/makefile.shade index a6ee205346..6c32f8ea6f 100644 --- a/makefile.shade +++ b/makefile.shade @@ -16,6 +16,7 @@ functions static string BUILD_BRANCH = Environment.GetEnvironmentVariable("BUILD_BRANCH") ?? "dev"; static string BASE_DIR = Directory.GetCurrentDirectory(); static string TARGET_DIR = Path.Combine(BASE_DIR, "artifacts", "build"); + static bool SKIP_NO_CREDENTIALS = Environment.GetEnvironmentVariable("UNIVERSE_SKIP_NO_CREDENTIALS") == "1"; string[] repos = new[] { // The repos list is topologically sorted based on build order "Configuration", @@ -438,6 +439,14 @@ functions if (useHttps && !IsAccessible(repo)) { + if (SKIP_NO_CREDENTIALS) + { + // This is used on the XPlat CI. Must return because otherwise git will wait for user + // input and hang the build + Log.Warn(string.Format("The repo at '{0}' is not accesible and it will not be cloned.", repoUrl)); + return; + } + Log.Warn(string.Format("The repo at '{0}' is not accessible. If you do not have access to this repository, skip the git prompt" + " for credentials to skip cloning this repository. To avoid this prompt, re-clone the Universe repository over ssh.", repoUrl));