Chartmuseum.cr is a Chartmuseum API wrapper writes with Crystal Language.
Inspired from gitlab.
- Add the dependency to your
shard.yml
:
dependencies:
chartmuseum:
github: devops-israel/chartmuseum.cr
- Run
shards install
require "chartmuseum"
# configuration
endpoint = "https://charts.example.com" # No tailing forward slash
username = "<username>"
password = "<password>"
# initialize a new client with user and password for basic auth
chartmuseum_client = Chartmuseum.client(endpoint, username, password)
# => #<Chartmuseum::Client:0x101653f20 @endpoint="https://charts.example.com", @username="xxx", @password="xxx>
# server health
chartmuseum_client.available?
# true
# get all charts and their versions
charts = chartmuseum_client.charts
# => {"application-1":[{"name":"application-1","version":"6410","description":"application-1 Chart","apiVersion":"v1","appVersion":"6410","urls":["charts/application-1-6410.tgz"],"created":"2019-01-27T08:43:46Z","digest":"10abe509f97a8ca20d7be48459cc3cd5190a9800783744b751cb98e98263ed09"},...]}
# get specific chart and its versions
charts = chartmuseum_client.chart("application-1")
# => [{"name":"application-1","version":"6410","description":"application-1 Chart","apiVersion":"v1","appVersion":"6410","urls":["charts/application-1-6410.tgz"],"created":"2019-01-27T08:43:46Z","digest":"10abe509f97a8ca20d7be48459cc3cd5190a9800783744b751cb98e98263ed09"},...]
# get specific version of a chart
charts = chartmuseum_client.version("application-1", "6412")
# => {"name":"application-1","version":"6412","description":"application-1 Chart","apiVersion":"v1","appVersion":"6412","urls":["charts/application-1-6412.tgz"],"created":"2019-01-27T08:43:46Z","digest":"10abe509f97a8ca20d7be48459cc3cd5190a9800783744b751cb98e98263ed09"}
GET /api/charts
- list all chartsGET /api/charts/[name]
- list all versions of a chartGET /api/charts/[name]/[version]
- describe a chart version
GET /health
- returns 200 OK
POST /api/charts
- upload a new chart versionPOST /api/prov
- upload a new provenance fileDELETE /api/charts/[name]/[version]
- delete a chart version (and corresponding provenance file)
- From inside the root of the project run
docker-compose up
- The container is configured to run tests every time a file is changed so just start developing.
- Fork it (https://github.com/devops-israel/chartmuseum.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Josh Dvir - creator and maintainer
MIT License © devops-israel