From 5cc80475ffeb0bfe0b211a66ff7571479e5c3b85 Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Thu, 19 May 2022 11:16:27 -0600
Subject: [PATCH 1/2] Remove GITLAB_TOKEN

---
 Dockerfile                 |  5 +----
 gradle/repositories.gradle | 46 ++------------------------------------
 ws.Dockerfile              |  5 +----
 3 files changed, 4 insertions(+), 52 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 7a5ba31d4..eaaf180b2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,10 +35,7 @@ ARG FROM_IMAGE=usgs/amazoncorretto:11
 ####
 FROM ${BUILD_IMAGE} as builder
 
-# TODO
-# Remove once nshmp-lib is public
-ARG GITLAB_TOKEN=null
-ARG CI_JOB_TOKEN=null
+# FOr GitLab CI/CD
 ARG CI_PROJECT_URL=null
 ARG CI_COMMIT_BRANCH=null
 
diff --git a/gradle/repositories.gradle b/gradle/repositories.gradle
index 56b28470d..394c441cc 100644
--- a/gradle/repositories.gradle
+++ b/gradle/repositories.gradle
@@ -1,50 +1,8 @@
-
-publishing {
-  publications {
-    library(MavenPublication) {
-      groupId = "ghsc"
-      version = project.getProperty("version")
-      version = version == "unspecified" ? "latest" : version
-      from components.java
-    }
-  }
-
-  repositories {
-    maven {
-      url "https://code.usgs.gov/api/v4/projects/2148/packages/maven"
-      name = "GitLab"
-      credentials(HttpHeaderCredentials) {
-        name = 'Job-Token'
-        value = System.getenv("CI_JOB_TOKEN")
-      }
-      authentication {
-        header(HttpHeaderAuthentication)
-      }
-    }
-  }
-}
-
 repositories {
   mavenCentral()
 
   maven {
-    url "https://code.usgs.gov/api/v4/groups/160/-/packages/maven"
-    name "GitLab"
-    if (System.getenv("CI_JOB_TOKEN") && System.getenv("CI_JOB_TOKEN") != "null") {
-      credentials(HttpHeaderCredentials) {
-        name = "Job-Token"
-        value = System.getenv("CI_JOB_TOKEN")
-      }
-    } else if (System.getenv("GITLAB_TOKEN") && System.getenv("GITLAB_TOKEN") != "null") {
-      credentials(HttpHeaderCredentials) {
-        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)
-    }
+    url "https://code.usgs.gov/api/v4/groups/1352/-/packages/maven"
+    name "NSHMP GitLab Group"
   }
 }
diff --git a/ws.Dockerfile b/ws.Dockerfile
index cae23f1bb..cd8b4c23c 100644
--- a/ws.Dockerfile
+++ b/ws.Dockerfile
@@ -23,10 +23,7 @@ FROM ${BUILD_IMAGE} as builder
 
 ARG builder_workdir
 
-# TODO
-# Remove once nshmp-lib is public
-ARG GITLAB_TOKEN=null
-ARG CI_JOB_TOKEN=null
+# For GitLab CI/CD
 ARG CI_PROJECT_URL=null
 ARG CI_COMMIT_BRANCH=null
 
-- 
GitLab


From 714ab562a6a03085dffa021e3045f9b684f0a602 Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Thu, 19 May 2022 11:17:47 -0600
Subject: [PATCH 2/2] Remove gitlab token references

---
 .gitlab-ci.yml | 2 --
 ws.Dockerfile  | 1 -
 2 files changed, 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7fc13f023..532498114 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -183,7 +183,6 @@ CHS Registry:
       BUILD_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
       FROM_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
       CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
-      CI_JOB_TOKEN=${CI_JOB_TOKEN}
       CI_PROJECT_URL=${CI_PROJECT_URL}
     PUSH_DOCKER: 'true'
     UPSTREAM_PATH: ghsc/nshmp/nshmp-haz
@@ -210,7 +209,6 @@ Container Registry:
       BUILD_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
       FROM_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
       CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
-      CI_JOB_TOKEN=${CI_JOB_TOKEN}
       CI_PROJECT_URL=${CI_PROJECT_URL}
     UPSTREAM_PATH: ghsc/nshmp/nshmp-haz
 
diff --git a/ws.Dockerfile b/ws.Dockerfile
index cd8b4c23c..fcb0d6768 100644
--- a/ws.Dockerfile
+++ b/ws.Dockerfile
@@ -4,7 +4,6 @@
 # Build locally:
 #   docker build
 #       -f ws.Dockerfile
-#       --build-arg gitlab_token=<git-api-token>
 #       -t nshmp-haz-ws .
 #
 # Run locally:
-- 
GitLab