首页 > 解决方案 > 如何让 git log 到另一个仓库?

问题描述

我有一个 GitHub 存储库 A,其中包含要部署的代码。还有一个 gitbun repo B,其中包含图表。我在 repo A 中创建了一个 GitHub Action,所以当我提交时,docker 构建我的图像并将其放入 ECR。Repo B 与 ArgoCD 互锁,因此其图表可以部署到 EKS 集群。

当我使用 docker 构建镜像时,我将相应的 git log 设置为标签。我想将此标签放入values.yamlrepo B 中,以便可以自动部署图表。

标签: argocdgitops

解决方案


您可以使用 GitOpsCLI 实现:https ://baloise.github.io/gitopscli/commands/deploy/

# values.yaml
foo:
  bar: 123
  baz: xyz
docker run --rm -it baloise/gitopscli deploy \
  --username "IGNORED" \
  --password $GITHUB_API_KEY \
  --git-user "GitOps CLI" \
  --git-email "gitopscli@baloise.dev" \
  --organisation "repoorg" \
  --repository-name "reponame" \
  --file "values.yaml" \
  --values "{foo.bar: $YOUR_GIT_HASH, foo.baz: $YOUR_GIT_HASH}"

推荐阅读