Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to publish to gitlab package registry #30

Open
jwhitcraft opened this issue Mar 20, 2024 · 6 comments
Open

Unable to publish to gitlab package registry #30

jwhitcraft opened this issue Mar 20, 2024 · 6 comments

Comments

@jwhitcraft
Copy link

Since this always assume that the registry is an OCI registry, it doesn't publish to gitlab.

"semantic-release-helm3",
      {
          "chartPath": ".",
          "isChartMuseum": false,
          "registry": "https://gitlab.com/api/v4/projects/12345678/packages/helm/release",
          "skipRegistryLogin": true
      }

and I get this error when i try and publish

An error occurred while running semantic-release: Error: Command failed with exit code 1: helm push /builds/test/devops/charts/test/gustpTest-1.1.1.tgz oci://https://gitlab.com/api/v4/projects/12345678/packages/helm/release
Error: invalid_reference: invalid repository
@nflaig
Copy link
Owner

nflaig commented Mar 20, 2024

I am not familiar with what gitlab uses but might have to implement something similar to github

async function publishChartUsingCr({chartPath, crConfigPath, packageArgs}, context) {

@jwhitcraft
Copy link
Author

So i got this working with the following config

    {
          "chartPath": ".",
          "isChartMuseum": true,
          "registry": "https://gitlab.com/api/v4/projects/1234567/packages/helm/release",
          "skipRegistryLogin": true,
          "cmPushArgs": "-d"
      }

and just doing the helm registry login in my before_step of my pipeline since if it's gitlab you need the whole repo on it, not just gitlab.com

@3j0s
Copy link

3j0s commented Apr 5, 2024

Greetings!
I got the same issue that @jwhitcraft had weeks ago since I'am not be able to publish on my gitlab registry, although I could register on gitlab on "before_script":

    helm repo add --username ${REGISTRY_USERNAME} --password ${REGISTRY_PASSWORD} semantic-release-helm  ${REGISTRY_HOST}

This is the configuration that I have:

          {
            "chartPath": . ,
            "registry": "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/${CI_COMMIT_BRANCH}",
            "isChartMuseum": true,
             "skipRegistryLogin": true
          }

And still it doesn't works, this the error that I get

[7:19:25 PM] [semantic-release] › ✘  Failed step "publish" of plugin "semantic-release-helm3"
[7:19:25 PM] [semantic-release] › ✘  An error occurred while running semantic-release: Error: Command failed with exit code 1: helm cm-push . semantic-release-helm
.
.
.
. Error: 413: could not properly parse response JSON: Request Entity Too Large

@nflaig
Copy link
Owner

nflaig commented Apr 5, 2024

[7:19:25 PM] [semantic-release] › ✘ Failed step "publish" of plugin "semantic-release-helm3"
[7:19:25 PM] [semantic-release] › ✘ An error occurred while running semantic-release: Error: Command failed with exit code 1: helm cm-push . semantic-release-helm
.
.
.
. Error: 413: could not properly parse response JSON: Request Entity Too Large

This looks like an error from the gitlab server, the payload you are sending is too large

@3j0s
Copy link

3j0s commented Apr 6, 2024

For some reason I did everything from the scratch and now it's seems that is working even the version increment, nevertheless I noticed that although the tag and chart version works fine, the Chart.yaml is not updated in the source main project.
Btw: Thx for this plugin

@nflaig
Copy link
Owner

nflaig commented Apr 6, 2024

the Chart.yaml is not updated in the source main project

Might be a configuration on semantic release itself, version update is independent from any registry, you can check your release logs for this

doc.set('version', version);
logger.log('Updating Chart.yaml with version %s.', version);

Note that it also part of prepare step, so if that would fail (e.g. due to file permissions) the publish wouldn't have worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants