diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fc13f023bd4bb0cf60913f5a7fd253204f0012f..53249811489a6bbd8d0fe13361c4a58c33922d7e 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/Dockerfile b/Dockerfile index 7a5ba31d4ec3d4dcc2968e770dd696257b5d88a9..eaaf180b28295cfc72fee3a4bdb79ad86fade06c 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 56b28470daad936f05128847b6d4cf70d808b667..394c441cc91669f10b266dd9333d9a5e1b5a1e21 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 cae23f1bba8f23892a8033c0ea9733acc0f1cd7e..fcb0d676825facf852e595db91df981618bda4e0 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: @@ -23,10 +22,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