4.10. (可选)集成 Sonatype Nexus 仓库
使用这个流程将 Sonatype Nexus 存储库的现有实例与 RHADS - SSC 集成。此集成允许您在 CI/CD 操作过程中将 Nexus 存储库用作工件 registry。
先决条件
- Nexus 容器注册表的 URL
- Nexus registry 的用户名和密码
流程
(可选)创建临时环境变量并存储以下值:
REGISTRY_URL="<url to the nexus container registry>" AUTHFILE='auth.json' # This file will be created in the next step.
REGISTRY_URL="<url to the nexus container registry>" AUTHFILE='auth.json' # This file will be created in the next step.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您选择不创建这些变量,请记得将代码示例中的变量替换为相关值。
使用 Podman 登录到 Nexus 容器 registry,并生成与 Docker 兼容的身份验证文件:
podman login --authfile="${AUTHFILE}" "${REGISTRY_URL}"
podman login --authfile="${AUTHFILE}" "${REGISTRY_URL}"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 此命令登录 Nexus,创建一个
auth.json
文件,并将 Nexus 用户名和密码存储在其中。在
tssc
容器中,运行以下集成命令:tssc integration nexus \ --url="${REGISTRY_URL}" \ --dockerconfigjson="$(cat ${AUTHFILE})"
tssc integration nexus \ --url="${REGISTRY_URL}" \ --dockerconfigjson="$(cat ${AUTHFILE})"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 删除本地
auth.json
文件,因为它已不再需要。rm "${AUTHFILE}"
rm "${AUTHFILE}"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow