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

Support private Docker registries in bitbucket-pipelines.yml #13555

Closed
sti0 opened this issue Jan 14, 2022 · 6 comments · Fixed by #21102
Closed

Support private Docker registries in bitbucket-pipelines.yml #13555

sti0 opened this issue Jan 14, 2022 · 6 comments · Fixed by #21102
Assignees
Labels
manager:bitbucket-pipelines Bitbucket pipelines manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@sti0
Copy link

sti0 commented Jan 14, 2022

What would you like Renovate to be able to do?

Bitbucket pipelines supports private Docker registries. This images are not hooked up by renovate.

Example:

image:
  name: "my.custom-domain.com/myimage:1.0.0"
  username: my-user
  password: my-password

pipelines:
  default:
    - step:
        name: Echo
        script:
          - echo "Hello World"
    - step:
        name: Important
        image:
          name: "my.custom-domain.com/importantimg:1.0.0"
          username: my-user
          password: my-password
        script:
          - important-cli

Checking for image: "my.custom-domain.com/myimage:1.0.0" works as expected.

See: Using private build images

If you have any ideas on how this should be implemented, please tell us here.

Improve the current regex

Is this a feature you are interested in implementing yourself?

No

@sti0 sti0 added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality) labels Jan 14, 2022
@viceice viceice added manager:bitbucket-pipelines Bitbucket pipelines manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready and removed status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage labels Jan 14, 2022
@viceice
Copy link
Member

viceice commented Jan 14, 2022

I don't think this can be easily covered by regex, as the keys can be in any order. We should instead parse the file as yaml.

@sti0
Copy link
Author

sti0 commented Jan 14, 2022

Please note that the syntax could appear within the steps as well:

image:
  name: "my.custom-domain.com/myimage:1.0.0"
  username: my-user
  password: my-password

pipelines:
  default:
    - step:
        name: Echo
        script:
          - echo "Hello World"
    - step:
        name: Important
        image:
          name: "my.custom-domain.com/importantimg:1.0.0"
          username: my-user
          password: my-password
        script:
          - important-cli

@sti0
Copy link
Author

sti0 commented Jan 14, 2022

As a workaround I added this regexManager and it seems to work:

{
  "regexManagers": [
    {
      "fileMatch": ["^bitbucket-pipelines.yml$"],
      "matchStrings": [
        "\\s*-?\\s?image:\\s*\\n\\s+name:\\s+\"?(?<depName>[a-z/.-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
      ],
      "datasourceTemplate": "docker",
      "versioningTemplate": "docker"
    }
  ]
}

@setchy
Copy link
Collaborator

setchy commented Mar 22, 2023

➕ to improving bitbucket-pipelines.yml private registry support.

we're using a slight modification to the above workaround

{
  "regexManagers": [
    {
      "matchManagers": ["bitbucket-pipelines"],
      "matchStrings": [
        "\\s*-?\\s?image:\\s*\\n\\s+name:\\s+\"?(?<depName>[a-z/.-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
      ],
      "datasourceTemplate": "docker",
      "versioningTemplate": "docker"
    }
  ]
}

@setchy
Copy link
Collaborator

setchy commented Mar 23, 2023

This page contains the full Docker image yaml spec used by Bitbucket Pipelines

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 35.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:bitbucket-pipelines Bitbucket pipelines manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants