From e3b2f5e94762e11b04d82e3c2871a73a718cf756 Mon Sep 17 00:00:00 2001 From: bclayton-usgs <bclayton@usgs.gov> Date: Tue, 3 Nov 2020 08:55:02 -0700 Subject: [PATCH] update get of nshmp-lib --- gradle/repositories.gradle | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle/repositories.gradle b/gradle/repositories.gradle index 56042ec..c8ecee1 100644 --- a/gradle/repositories.gradle +++ b/gradle/repositories.gradle @@ -34,16 +34,18 @@ repositories { maven { url "https://code.usgs.gov/api/v4/groups/160/-/packages/maven" name "GitLab" - if (System.getenv("CI_JOB_TOKEN") != 'null') { + if (System.getenv("CI_JOB_TOKEN") && System.getenv("CI_JOB_TOKEN") != "null") { credentials(HttpHeaderCredentials) { - name = 'Job-Token' + name = "Job-Token" value = System.getenv("CI_JOB_TOKEN") } - } else { + } else if (System.getenv("GITLAB_TOKEN") && System.getenv("GITLAB_TOKEN") != "null") { credentials(HttpHeaderCredentials) { - name = 'Private-Token' + name = "Private-Token" value = System.getenv("GITLAB_TOKEN") } + } else { + throw new GradleException("CI_JOB_TOKEN or GITLAB_TOKEN environmental variable must be set") } authentication { header(HttpHeaderAuthentication) -- GitLab