本文介绍如何在GitOps系统中添加、查看及删除Git源仓库。
前提条件
已登录GitOps系统。具体操作,请参见登录GitOps系统。
添加Git源仓库
您可以通过以下几种方式添加Git源仓库。
-
执行以下命令,添加示例应用的Git源仓库到GitOps系统中。
argocd repo add https://github.com/AliyunContainerService/gitops-demo.git
预期输出:
Repository 'https://github.com/AliyunContainerService/gitops-demo.git' added
-
使用用户名密码,通过HTTPS添加私有Git源仓库的示例如下。
argocd repo add https://git.example.com/repos/repo --username git --password secret
-
使用私钥证书,通过SSH协议添加Git源仓库并忽略服务器证书校验的示例如下。
argocd repo add git@git.example.com:repos/repo --insecure-ignore-host-key --ssh-private-key-path ~/id_rsa
执行以下命令,查看更多参数的使用说明。
argocd repo add --help
查看Git源仓库
执行以下命令,查看Git源仓库列表。
argocd repo list
预期输出:
TYPE NAME REPO INSECURE OCI LFS CREDS STATUS MESSAGE PROJECT
git https://github.com/AliyunContainerService/gitops-demo.git false false false false Successful
删除Git源仓库
执行以下命令,删除Git源仓库。
argocd repo rm https://github.com/AliyunContainerService/gitops-demo.git
预期输出:
Repository 'https://github.com/AliyunContainerService/gitops-demo.git' removed
内容没看懂? 不太想学习?想快速解决? 有偿解决: 联系专家
阿里云企业补贴进行中: 马上申请
腾讯云限时活动1折起,即将结束: 马上收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利:同意关联,立享优惠
转转请注明出处:https://www.yunxiaoer.com/170085.html