Skip to content

mikube/depreq

Repository files navigation

🚀 depreq

Deploy Requester for GitOps.

Clone a manifest repository, update tags, commit the change, and create a pull request! (from CI context)

Handmade scripts are no longer needed.

Here is an automatically created pull request sample.

🔱 Supported Options

Template Engines

  • Yaml
    • Helm
    • Kustomize
    • Plain kubernetes manifest
  • Any
    • By regular expression

Git Repositories

  • GitHub

🔜 Usage

Download a single binary from release page.

# CI on application repository
depreq \
  --git-user amaya382 \
  --git-email [email protected] \
  --git-token <your-git-token> \
  --git-token-user amaya382 \
  --manifest-uri 'https://github.com/gitops-demo/manifests.git' \
  --manifest-base-branch dev \
  --manifest-values-files app-a/values/dev-app-a.yaml:app-a/values/prd-app-a.yaml \
  --manifest-tag-keys 'image.repository' \
  --app-image gitopsdemo/app-a \
  --app-curr-commit <commit-hash-from-ci> \
  --github-user amaya382

And also you can use docker images.

How to update tags

By key

You can use a brief query. . for map, [*]. for array.

# --manifest-tag-keys 'image.repository'
image:
  repository: gitops-demo/app-a:1234567890abcdef
# --manifest-tag-keys 'tag'
image: gitops-demo/app-a
tag: 1234567890abcdef
# --manifest-tag-keys 'spec.template.spec.containers[*].image'
spec:
  template:
    spec:
      containers:
      - name: app-1
        image: gitops-demo/app-a:1234567890abcdef
      - name: app-2
        image: gitops-demo/app-a:1234567890abcdef

By regular expression

If you want to update tags by regular expression, use '--manifest-tag-pattern' instead of '--manifest-tag-keys'.

# --manifest-tag-pattern 'repository: gitops-demo/app-a:[\da-f]+$'
image:
  repository: gitops-demo/app-a:1234567890abcdef
# --manifest-tag-pattern 'tag: [\da-f]+$'
image: gitops-demo/app-a
tag: 1234567890abcdef
# --manifest-tag-pattern 'image: gitops-demo/app-a:[\da-f]+$'
spec:
  template:
    spec:
      containers:
      - name: app-1
        image: gitops-demo/app-a:1234567890abcdef
      - name: app-2
        image: gitops-demo/app-a:1234567890abcdef

📍 Note

  • Now depreq uses a git commit hash as an image tag