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

[CLI-FEATURE] add registries options for oc publish #1277

Merged
merged 5 commits into from
Nov 16, 2021

Conversation

ricardo-devis-agullo
Copy link
Collaborator

@ricardo-devis-agullo ricardo-devis-agullo commented Nov 13, 2021

Right now, to publish to registries you need to have set a oc.json file with your registries. This works well when you only publish to one registry, or you always publish to all the registries at the same time (so you can have your oc.json versioned in your repo and just use it).

The problem is that that solution doesn't work as well when your deployment setup is to publish to a different registry depending on your environment (1 or more registries on each environment). In that case, for every deployment, you have to go and edit the oc.json before being able to call oc publish.

For those cases, I'm adding a new option --registries that allows you to pass a list of registries that will override your oc.json configuration. So when you want to publish you can just do

oc publish your-component --registries http://www.myregistry.com https://www.myregistry2.com

without needing a oc.json

registries: {
array: true,
description:
'registries to publish, overriding your configuration in oc.json'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List of registries to publish to. This setting will take precedence over oc.json file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -101,6 +102,20 @@ describe('cli : facade : publish', () => {
});
});

it('should take precedence the registries set through options', done => {
Copy link
Collaborator

@pbazydlo pbazydlo Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should take precedence over the registries set through oc.json

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ricardo-devis-agullo ricardo-devis-agullo merged commit 13202cb into master Nov 16, 2021
@ricardo-devis-agullo ricardo-devis-agullo deleted the registries-option-on-publish branch November 16, 2021 15:46
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

Successfully merging this pull request may close these issues.

2 participants