Skip to content
Snippets Groups Projects
Commit b7ec9d8c authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Merge branch 'issue-519' into 'main'

Resolves - Remove GITLAB_TOKEN Requirement

Closes #519

See merge request !636
parents 36b39f2b 714ab562
No related branches found
No related tags found
2 merge requests!637Production Release | nshmp-haz,!636Resolves - Remove GITLAB_TOKEN Requirement
Pipeline #145104 passed
......@@ -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
......
......@@ -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
......
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"
}
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment