我为nexus3安装了helm repo plugin
现在,我希望通过RestAPI命令创建helm托管存储库,方法与创建原始存储库相同
# RAW Repository
curl -X POST "${NEXUS_URL}/service/rest/v1/script" \
--user "admin:admin123" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"name\": \"create_raw_repo\", \"content\": \"repository.createRawHosted(args, 'default')\", \"type\": \"groovy\"}"
curl -X POST "${NEXUS_URL}/service/rest/v1/script/create_raw_repo/run" \
--user "admin:admin123" \
-H "accept: application/json" \
-H "Content-Type: text/plain" \
-d "raw-release"
# HELM Repo
curl -X POST "${NEXUS_URL}/service/rest/v1/script" \
--user "admin:admin123" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"name\": \"create_helm_repo\", \"content\": \"repository.createHelmHosted(args, 'default')\", \"type\": \"groovy\"}"
curl -X POST "${NEXUS_URL}/service/rest/v1/script/create_helm_repo/run" \
--user "admin:admin123" \
-H "accept: application/json" \
-H "Content-Type: text/plain" \
-d "helm-demo-release"问题是repository.createHelmHosted方法并不存在。
正确的做法是什么?
发布于 2020-03-11 21:58:52
从版本3.21开始,nexus支持OOB helm存储库,并具有REST API来创建存储库
http://you-nexus:8081/service/rest/beta/repositories/helm/hosted
curl -X POST "http://you-nexus:8081/service/rest/beta/repositories/helm/hosted" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"name\": \"internal\", \"online\": true, \"storage\": { \"blobStoreName\": \"default\", \"strictContentTypeValidation\": true, \"writePolicy\": \"allow_once\" }, \"cleanup\": { \"policyNames\": \"weekly-cleanup\" }}"https://stackoverflow.com/questions/57774093
复制相似问题