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

Save the source when a mixin is installed #610

Closed
carolynvs opened this issue Sep 14, 2019 · 0 comments · Fixed by #666
Closed

Save the source when a mixin is installed #610

carolynvs opened this issue Sep 14, 2019 · 0 comments · Fixed by #666
Labels
enhancement New code incoming! help wanted Good for someone who has contributed before

Comments

@carolynvs
Copy link
Member

carolynvs commented Sep 14, 2019

When we install a mixin, we need to remember where it came from so that we can upgrade it later without having to specify again where to get the new binaries.

Porter should save this to a new file located at PORTER_HOME/mixins/cache.json.

{
  "mixins": [
    {
      "name": "azure",
      "feedURL": "https://cdn.deislabs.io/porter/atom.xml"
    },
    {
      "name": "mymixin",
      "url": "https://github.com/org/proj/releases/downloads"
    }
  ]
}

feedURL and url correspond to the original flags passed to porter mixin install, which can be either --feedURL or --url.

I suggest looking at implementing this functionality in this area:

https://github.com/deislabs/porter/blob/b24cdd412147c8156942f6d8accb489e71e48e6f/pkg/mixin/provider/install.go#L17-L23

It has a reference to a Config struct which has useful methods like getMixinsDir() which you will need in order to figure out where to write the file.

You can test this out by building and installing porter, then running porter mixin install exec. Then check the file in ~/.porter/mixins/cache.json.

@carolynvs carolynvs added the enhancement New code incoming! label Sep 14, 2019
@carolynvs carolynvs added this to the Mixin Distribution milestone Sep 14, 2019
@carolynvs carolynvs added good first issue Good for new contributors help wanted Good for someone who has contributed before and removed good first issue Good for new contributors labels Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New code incoming! help wanted Good for someone who has contributed before
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant