unbroken-dome / gradle-helm-plugin

A Gradle plugin for building, publishing and managing Helm charts.
MIT License
51 stars 55 forks source link

OCI support #155

Open Kent1 opened 2 years ago

Kent1 commented 2 years ago

We already use ECR (AWS) for publishing our docker images. I would like to use the same repository for publishing Helm charts. Right now, OCI support is experimental in Helm but works already quite well. Are there plans to support OCI repositories in this plugin ?

https://github.com/helm/community/blob/main/hips/hip-0006.md

bademux commented 1 year ago

Any news on that? https://helm.sh/blog/storing-charts-in-oci/

helm push demo-0.1.0.tgz oci://r.example.com/myuser

Update: Task to push helm chart to OCI registry. Pass registry as dockerDestRegistry and username\password as jib.to.auth.username jib.to.auth.password

//https://helm.sh/blog/storing-charts-in-oci/
task helmPush(dependsOn: tasks.helmPackageMyChart) {
    description = 'Push to OCI registry'
    group = 'helm'
    doLast {
        if (project.hasProperty('jib.to.auth.username') && project.hasProperty('jib.to.auth.password')) {
            helm.execHelm('registry', 'login') {
                args(dockerDestRegistry)
                option('--username', project.property('jib.to.auth.username'))
                option('--password', project.property('jib.to.auth.password'))
            }
        }
        helm.execHelm('push', null) {
            args(tasks.helmPackageMyChart.packageFile.get() as String)
            args("oci://$dockerDestRegistry/${project.group.replace('.', '/')}")
        }
        helm.execHelm('registry', 'logout') {
            args(dockerDestRegistry)
        }
    }
}