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

Add cli argument to skip dependencies packaging #769

Closed
elboletaire opened this issue Nov 28, 2017 · 6 comments · Fixed by #1191
Closed

Add cli argument to skip dependencies packaging #769

elboletaire opened this issue Nov 28, 2017 · 6 comments · Fixed by #1191
Assignees

Comments

@elboletaire
Copy link
Collaborator

In some scenarios people tend to compile dependencies by their own before doing oc publish, so let's add a cli argument, something like --skip-dependencies or --skip-build, to allow us skip the dependencies installation later again via oc.

@elboletaire
Copy link
Collaborator Author

If I start working on it I'd assign it to me. Until then, I leave it open for others to collaborate.

@matteofigus
Copy link
Member

matteofigus commented Nov 28, 2017

So, given we have an oc package command (which contains the _package folder), perhaps I would name this --skip-package - so it would just publish whatever is inside _package (skipping the dependencies' check and all of that). What do you think?

@elboletaire
Copy link
Collaborator Author

I don't know the internals like you, so I guess your argument will probably fit better than mine :_D

@elboletaire elboletaire self-assigned this Nov 9, 2018
@elboletaire elboletaire changed the title Add cli argument to skip dependencies check/build Add cli argument to skip dependencies packaging Nov 9, 2018
@matteofigus
Copy link
Member

@elboletaire look at @NimaSoroush's PR that we just merged. Sounds like very similar but for packaging (skips install and does symlinking) #971

@elboletaire
Copy link
Collaborator Author

Thanks @matteofigus. Thing is I wasn't able to dedicate more time to this since last time, but I'll look into it as soon as I've time again 😃

@ricardo-devis-agullo
Copy link
Collaborator

ricardo-devis-agullo commented Aug 10, 2021

I was thinking on taking on this issue and I think there's 3 use cases to consider when doing this new command.

1. Mirroring what publish does on the same component

oc package your-component-folder
oc publish your-component-folder --skip-package

In this case the scenario is you have your component, you package first, it creates the _package folder, so when you run the second command, it just tries to find a _package folder inside, and then it will compress, and publish it.

2. Publishing the folder itself

oc package your-component-folder
... store the _package folder somewhere to be published later
oc publish _package --skip-package

In this case, the component is already gone, as we only stored the artifact of the package to be deployed/published at a later stage. So here the CLI will see that there's no _package folder inside of your path, so will try to find a package.json inside, and if there is one, check that we are on a compiled package (checking that theres an oc.packaged = true could do the trick here) and publish those files.

3. Publishing a compressed file

oc package your-component-folder --compress
... store the tar.gz file somewhere to be published later
oc publish your-file.tar.gz

Similar to the case 2 but here we also compress and we want to publish that file. In this case I don't see the point of skipping package, since CLI could already assume that if the path is of a compressed file, you just want to publish that.

Does this approach make sense?

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

Successfully merging a pull request may close this issue.

3 participants