{"id":16288506,"url":"https://github.com/kiemlicz/shelm","last_synced_at":"2025-06-17T05:32:47.805Z","repository":{"id":38315369,"uuid":"275895161","full_name":"kiemlicz/shelm","owner":"kiemlicz","description":"SBT Helm plugin","archived":false,"fork":false,"pushed_at":"2025-02-22T12:54:01.000Z","size":1765,"stargazers_count":21,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T09:50:59.421Z","etag":null,"topics":["helm","helm-chart","sbt","sbt-plugin","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiemlicz.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-29T18:28:00.000Z","updated_at":"2025-02-22T12:54:05.000Z","dependencies_parsed_at":"2023-12-21T19:10:31.202Z","dependency_job_id":"fa0cc7b5-6aaa-4844-af87-d506947fbadd","html_url":"https://github.com/kiemlicz/shelm","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/kiemlicz/shelm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiemlicz%2Fshelm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiemlicz%2Fshelm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiemlicz%2Fshelm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiemlicz%2Fshelm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiemlicz","download_url":"https://codeload.github.com/kiemlicz/shelm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiemlicz%2Fshelm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260298959,"owners_count":22988543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helm","helm-chart","sbt","sbt-plugin","scala"],"created_at":"2024-10-10T19:48:30.824Z","updated_at":"2025-06-17T05:32:47.752Z","avatar_url":"https://github.com/kiemlicz.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Helm Plugin - SHelm\nThis plugin enables packaging and publishing Helm Charts from SBT. It offers support for OCI registries and enables the validation of Charts during the build process.\n\n1. **Build-Time Chart Management**    \n    Fully manage Chart during build-time, enables adding \"external\" configuration files.  \n    Helm has long-standing [issue](https://github.com/helm/helm/issues/3276) about addition of external files into Helm Charts.  \n    This plugin \"kind of\" addresses this issue.  \n    It allows users to add any additional files to the Helm Chart without imposing security issues raised in the aforementioned ticket.\n    The additional files are accessible only during build time and packaged into Chart.\n\n2. **Chart Publishing**    \n    SHelm supports the publishing of Charts to Helm repositories.  \n    It is compatible with OCI-based registries, Chart Museum (utilizing an dedicated HTTP client, eliminating the need for `cm-plugin`), and 'ivy-style' repositories such as Artifactory.\n\n3. **Chart Linting**    \n    Starting from SHelm 0.8.0, users can utilize a strict linter and [lint against a provided Kubernetes version](https://github.com/helm/helm/pull/10677).  \n    This feature enhances the development process by identifying potential issues early on.\n\n## Usage\nSee [Changelog](Changelog.md) for compatibility and upgrade instructions.\n\nDescription of main introduced tasks\n\n### HelmPlugin\n| command                     | description                                                                                                                                                                                                                                                                                      |\n|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `Helm / packagesBin`        | lints and creates Helm Chart                                                                                                                                                                                                                                                                     |\n| `Helm / lint`               | lints Helm Chart. Strict lint requires Helm version \u003e= 3.14                                                                                                                                                                                                                                      |\n| `Helm / prepare`            | copies Chart directory into `target/chartName` directory with all configured dependencies                                                                                                                                                                                                        |\n| `Helm / setupRegistries`    | login to OCI registries and adds Helm repositories configured with `Helm / repositories` setting. Adding existing repository multiple times is considered a safe operation. However, the `https://repo/stable` and `https://repo/stable/` are different URLs and cannot be added under same name |\n| `Helm / updateRepositories` | performs `helm repo update`                                                                                                                                                                                                                                                                      |\n| `Helm / publish`            | Publishes the Chart into configured repository                                                                                                                                                                                                                                                   |\n\n### HelmPublishPlugin\n| command                     | description                                                                        |\n|-----------------------------|------------------------------------------------------------------------------------|\n| `Helm / publish`            | publishes Charts into configured `Helm / publishToHosting` registries/repositories |\n\n\n## Requirements \nHelm 3 [binary](https://helm.sh/docs/intro/install/) is required.  \nOCI registries are supported starting 3.8.  \nLinter against given Kubernetes version is supported starting with 3.14.  \n\n## Example\nRefer to [tests](https://github.com/kiemlicz/shelm/tree/master/src/sbt-test/shelm) for complete examples\n\nAdd `shelm` plugin to project:  \n_project/plugins.sbt_\n```\naddSbtPlugin(\"io.github.kiemlicz\" % \"shelm\" % \"0.9.0\")\n```\nCheck [tags](https://github.com/kiemlicz/shelm/tags) for latest available version.\n\n1\\. Create Chart from the local directory.  \n#### **`build.sbt`**\n```\nlazy val root = (project in file(\".\"))\n  .enablePlugins(HelmPlugin)\n  .settings(\n    version := \"0.1\",\n    scalaVersion := \"2.13.3\",\n    Helm / chartSettings := Seq(\n      ChartSettings(\n        chartLocation = ChartLocation.Local(ChartName(\"includes-chart\"), file(\"includes-chart\")),\n      )\n    ),\n    Helm / chartMappings := { s =\u003e\n      ChartMappings(\n        s,\n        destination = target.value,\n        chartUpdate = _.copy(version = \"1.2.3+meta.data\"),\n        includeFiles = Seq(\n          file(\"config\") -\u003e \"config\",\n          file(\"secrets\") -\u003e \"secrets\",\n          file(\"config2/single.conf\") -\u003e \"config/single.conf\",\n        ),\n        yamlsToMerge = Seq(\n          file(\"values.yaml\") -\u003e \"values.yaml\"\n        )\n      )\n    }\n  )\n```\n`sbt\u003e Helm / packagesBin` creates: `projectRoot/target/chart_name-1.2.3+meta.data.tgz`, which contains `config`, `config2` and `secrets` dirs.\nAdditionally, the `values.yaml` from Chart's directory will be merged with `values.yaml` present in project root.\n\n2\\. Create Chart which is in the already added Helm repository (re-pack).\n#### **`build.sbt`**\n```\nlazy val root = (project in file(\".\"))\n  .enablePlugins(HelmPlugin)\n  .settings(\n    version := \"0.1\",\n    scalaVersion := \"2.13.3\",\n    target in Helm := target.value / \"nestTarget\",\n    Helm / shouldUpdateRepositories := true,\n    Helm / chartSettings := Seq(\n      ChartSettings(\n        chartLocation = ChartLocation.AddedRepository(ChartName(\"redis\"), ChartRepositoryName(\"stable\"), Some(\"10.5.7\")),\n      )\n    ),\n    Helm / chartMappings := { s =\u003e\n      ChartMappings(\n        s,\n        destination = target.value / \"someExtraDir\",\n        chartUpdate = c =\u003e c.copy(version = s\"${c.version}+extraMetaData\"),\n        includeFiles = Seq(\n          file(\"extraConfig\") -\u003e \"extraConfig\"\n        ),\n        Seq.empty,\n        valueOverrides = _ =\u003e Seq(\n          Json.fromFields(\n            Iterable(\n              \"nameOverride\" -\u003e Json.fromString(\"testNameRedis\"),\n            )\n          )\n        ),\n        lintSettings = LintSettings(fatalLint=false)\n      )\n    }\n  )\n```\n`sbt\u003e Helm / packagesBin` creates: `projectRoot/target/someExtraDir/redis-10.5.7+extraMetaData.tgz`, \nthe downloaded and unpacked Chart can be found: `projectRoot/target/nestTarget/redis`.\nThe re-packed Redis Chart will contain `extraConfig` and `nameOverride` key set in `values.yaml`\n\nIt is also possible to use direct URI for Chart: `ChartLocation.Remote(URI.create(\"https://github.com/kiemlicz/ambassador/raw/gh-pages/salt-2.1.2.tgz\"))`  \nor not `helm repo add`'ed repository: `ChartLocation.RemoteRepository(\"thename\", URI.create(\"https://kiemlicz.github.io/ambassador/\"), ChartRepositorySettings.NoAuth, Some(\"2.1.3\"))`\n\n3\\. Publish Chart\n\nAdditionally to `Helm / chartSettings` and `Helm / chartMappings`, specify the repository.\n\n##### OCI registry\nSHelm can handle OCI registry login, or it can be left to user (`Helm/registriesLoginEnabled`)\n\n**`build.sbt`**\n```\nHelm / publishToHosting := Seq(OciChartRegistry(URI.create(\"oci://localhost:5011/test/\"), ChartRepositoryAuth.UserPassword(\"test\", \"test\"))),\n```\nRun `Helm / publish`\n\n##### ChartMuseum repository\nMind the URL: for ChartMuseum `api/charts` path segment is required however it is not well-defined (e.g. `api/tenant/charts`) - consult ChartMuseum owner how to set this up. \n**`build.sbt`**\n```\nHelm / publishToHosting := Seq(ChartMuseumRepository(ChartRepositoryName(\"bla\"), URI.create(\"http://localhost:8081/api/charts\"), ChartRepositoryAuth.UserPassword(\"test\", \"test\"))),\n```\nRun `Helm / publish`\n\nSee `sbt-test/shelm/publish-cm` and `sbt-test/shelm/publish-oci` for examples how to use Chart Museum and OCI registries\n\n##### IVY-style repository\n**`build.sbt`**\n```\ncredentials += Credentials(\"Artifactory Realm\", \"repository.example.com\", \"user\", \"pass\"),\nHelm / publishTo := Some(Resolver.url(\"Artifactory Realm\", url(\"https://repository.example.com/artifactory/helm/experiments/\"))(Patterns(\"[chartMajor].[chartMinor].[chartPatch]/[artifact]-[chartVersion].[ext]\"))),\nHelm / publishRegistries := Seq(ChartRepositoryName(\"Artifactory\"), URI.create(\"https://repository.example.com/artifactory/helm/experiments/\")),\n```\nAvailable extra Ivy attributes (for use in `Patterns`):\n- `chartName` Chart's name (`Chart.yaml`'s `name` field)\n- `chartVersion` full version of the Chart\n- `chartMajor` Chart's SemVer2 Major\n- `chartMinor` Chart's SemVer2 Minor\n- `chartPatch` Chart's SemVer2 Patch\n- [`chartMetadata`] Chart's metadata appended during execution of `packagesBin` task\n\n# Development notes\n### Releasing SHelm\nRelease is performed using [Github action](https://github.com/kiemlicz/shelm/actions?query=workflow%3ARelease).\nRun on `git tag` push.\n\nThe SHelm is versioned using SemVer2 with [GitVersioning](https://github.com/rallyhealth/sbt-git-versioning)\n\nArtifacts are hosted on [Maven Central](https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/kiemlicz/)\n\n[Consult following README](https://github.com/rallyhealth/sbt-git-versioning#notes) regarding the versioning. \n\n## Current related issues\n[SBT doesn't download sources in IntelliJ](https://youtrack.jetbrains.com/issue/SCL-17825)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiemlicz%2Fshelm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiemlicz%2Fshelm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiemlicz%2Fshelm/lists"}