首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过CLI实现helm hosted repo

通过CLI实现helm hosted repo
EN

Stack Overflow用户
提问于 2019-09-03 22:47:48
回答 1查看 214关注 0票数 0

我为nexus3安装了helm repo plugin

现在,我希望通过RestAPI命令创建helm托管存储库,方法与创建原始存储库相同

代码语言:javascript
复制
# 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方法并不存在。

正确的做法是什么?

EN

回答 1

Stack Overflow用户

发布于 2020-03-11 21:58:52

从版本3.21开始,nexus支持OOB helm存储库,并具有REST API来创建存储库

代码语言:javascript
复制
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\" }}"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57774093

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档