Git Product home page Git Product logo

semantic-release-helm-oci's Introduction

semantic-release-helm-oci

Warning

This project is in deprecation mode and needs a mantainer. Please check #9

semantic-release plugin for publishing Helm charts to OCI compatible registries.

NPM semantic-release MIT License

Step Description
verifyConditions Verify plugin configuration and login to Helm registry.
prepare Package Helm chart to local folder.
publish Publish Helm chart to OCI registry.

Installation

npm i @eshepelyuk/semantic-release-helm-oci -D

Usage

The plugin can be configured in the semantic-release configuration file :

.releaserc.json

{
  "plugins": [
    ["@eshepelyuk/semantic-release-helm-oci", {
      "registry": "oci://ghcr.io/eshepelyuk/abc"
    }]
  ]
}

.releaserc.yaml

plugins:
  -
    - '@eshepelyuk/semantic-release-helm-oci'
    - registry: oci://ghcr.io/eshepelyuk/abc

With this example, for each release, a Helm chart will be published to oci://ghcr.io/eshepelyuk/abc/${CHART_NAME}:${CHART_VERSION}. Where ${CHART_NAME} is a name from Chart.yaml and ${CHART_VERSION} is a version detected by semantic-release.

version and appVersion in Chart.yaml

Plugin intentionally doesn't modify Chart.yaml during the release. It's recommended to use Git tags for maintaining release versions.

The plugin leverages --version and --app-version when calling helm package to manage published chart versions and not rely on Chart.yaml.

There's two usage scenarios for this plugin:

  1. The chart and the application are co-located in the same repository.

    In this case, the version and appVersion are both changed during a release. This is a default plugin's behaviour.

  2. The chart is maintained separately from the application.

    In this case appVersion is modified outside of chart's release process and must be updated manually in Chart.yaml. To prevent plugin from setting --app-version - use skipAppVersion option.

Configuration

Environment variables

Credentials for OCI registry authentication are passed through environment variables:

Variable Description
REGISTRY_USERNAME Required. OCI registry username.
REGISTRY_PASSWORD Required. OCI registry password.

Options

Option Description Type Default
registry Required. Registry URL with oci:// schema,
e.g. oci://ghcr.io/eshepelyuk/abc.
string undefined
skipAppVersion Use appVersion from Chart.yaml when packaging chart, instead of using semantic-release nextVersion boolean false
chartPath Directory, where Chart.yaml is located. string .

semantic-release-helm-oci's People

Contributors

eshepelyuk avatar salzig avatar tverdohleb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

semantic-release-helm-oci's Issues

ES Modules

Hej,
using this plugin you'll nowadays get an Error like:

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/lib/node_modules/@semantic-release/error/index.js from /usr/lib/node_modules/@eshepelyuk/semantic-release-helm-oci/lib/verifyConditions.js not supported.
Instead change the require of index.js in /usr/lib/node_modules/@eshepelyuk/semantic-release-helm-oci/lib/verifyConditions.js to a dynamic import() which is available in all CommonJS modules.

which is related to how require/import/includes are handled in the JavaScript world.

Do you have time to work on the necessary change? Are you interested in a MergeRequest?

related Semantic-Release Issue: semantic-release/semantic-release#2133

Add chart path

Love the plugin. Currently, the plugin is hard coded to expect the chart at the root of the repository. It would be helpful to allow the user to configure the path to the chart.

Something like chartPath or similar would be helpful if you are still maintaining the project.

Chart.yaml must be must be located at `./`

I am missing a configuratin option where i can specify where the Chart.yaml is located in. Currently This plugin is not usable for my use case, i have several charts that i want to handle, e.g.

./charts/A/
./charts/B/

Proposal: Introduce a new parameter called chartPath that is used here

const ch = yaml.load(await fsPromises.readFile("./Chart.yaml"));
and here
const ch = yaml.load(await fsPromises.readFile("./Chart.yaml"));

Looking for a maintainer

Because I'm no longer using semantic-release, this project will be archived soon.
If anyone interested please feedback in this issue, I'm willing to pass the ownership.

[QUESTION] Do you publish this fork?

The original version of this isn't maintained. This fork has been updated to include chartPath. I would like to use this version. I'm wondering if you publish for consumption?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.