release-argus / Argus

Argus is a lightweight monitor to notify of new software releases via Gotify/Slack/other messages and/or WebHooks.
https://release-argus.io
Apache License 2.0
291 stars 11 forks source link

feat: service type dockerhub #207

Open treezio opened 1 year ago

treezio commented 1 year ago

Context

There are some repositories in github that are not managing their versions using the releases feature such as https://github.com/confluentinc/kafka-images but still publishing their images on dockerhub.

Goal

It would be nice to being able to use the dockerhub (it could be extended to other repositories) image tags from a given repository as the released versions.

Proposal

Some configuration to the following could be set:

    latest_version: 
      type: dockerhub
      repository: releaseargus/argus  # repository name
      access_token:  # Dockerhub token for private repositories 
      url_commands:
        - type: regex_submatch  # This searches the image tag
          regex: ^v?([0-9.]+)$

I know there is a latest_version.required.docker feature but I guess it still needs releases are generated in the github repository.

JosephKav commented 1 year ago

Hmm, currently you could query the tags page as url. I could add a github_tags type that'd query https://api.github.com/repos/confluentinc/kafka-images/tags (we look at /releases as this gives you assets uploaded for that release tag). I'll look into that aswell as this dockerhub approach soon. Thanks for the feature suggestion :)

  confluentinc/kafka-images:
    latest_version:
      type: url
      url: https://github.com/confluentinc/kafka-images/tags
      url_commands:
        - type: regex
          regex: \/releases\/tag\/v?([^"]+)\"
larsl-net commented 1 month ago

You can get a list of the tags over the Registry API, and with this base it should be possible to get the latest tag. I'm not sure if json filtering works here because of the array or you need to use regex. Ex.

https://hub.docker.com/v2/namespaces/confluentinc/repositories/confluent-operator/tags

Maybe it is an option to support oci artifacts as type instead/additional to docker hub/image registries then it is not only limited to Container images. This would add support for Helm charts and other custom artifacts (ex. authentik Blueprints).

Api request ex. https://quay.io/v2/prometheus/prometheus/tags/list

Spec: https://github.com/opencontainers/distribution-spec/blob/main/spec.md#content-discovery

For hub.docker.com ist seams that you need always a token. This is described in this issue with an example how to get this token. https://github.com/distribution/distribution/issues/1676