minishift/minishift-centos-iso

Provide a way to configure minishift from a source code repository

jorgemoralespou opened this issue · 3 comments

It'll be ideal if we can provide a way to have some minishift configuration along with an application source code so that a minishift profile can be easily configured.

This is the scenario I'm contemplating. When I work on an application I might configure a profile with specific addons, memory, images, etc to improve my productivity. I would like to save this configuration in a file/folder local to my source control system so that I can re-apply it at any time or that any other colleague working on this application can create a profile configured on the same way as I have.

Example of configuration I like to provide is:

  • cpus
  • memory
  • images to cache
  • addons to apply

Right now I have a file that I store under .minishift in my repository that has a script that sets the configuration to the active profile.

minishift config set cpus 4
minishift config set memory 8G
minishift config set image-caching true
minishift config set vm-driver virtualbox

minishift addon enable admin-user
minishift addon install addons/appA-deps --force --enable

minishift images cache-config add openshift/origin-docker-registry:v3.9.0
minishift images cache-config add openshift/origin-haproxy-router:v3.9.0
minishift images cache-config add openshift/origin:v3.9.0
minishift images cache-config add openshift/origin-pod:v3.9.0
minishift images cache-config add openshift/origin-deployer:v3.9.0
minishift images cache-config add openshift/origin-web-console:v3.9.0

I would like to define a .minishift folder with a config.json file and addons folder so that an easy command can import this configuration to my profile, or even create a new profile from this configuration.

e.g:

Create a new profile importing the confguration from my .minishift folder:

minishift profile set myappA --from=.

Import this configuration to my profile.

$ minishift profile import-from=.
Importing the configuration found in .minishift
No Minishift instance exists. New 'cpus' setting will be applied on next 'minishift start'
No Minishift instance exists. New 'memory' setting will be applied on next 'minishift start'
No Minishift instance exists. New 'vm-driver' setting will be applied on next 'minishift start'
Add-on 'admin-user' enabled
Addon 'appA-deps' installed
Add-on 'appA-deps' enabled

Maybe make the option interactive:

$ minishift profile import-from=.
Importing the configuration found in .minishift
Setting cpus to 4
Do you want to apply this setting? (y/n)
Setting memory to 8 GB.
Do you want to apply this setting? (y/n)
Setting vm-driver to virtualbox
Do you want to apply this setting? (y/n)
Adding add-on 'admin-user'
Do you want to apply this setting? (y/n)
Adding addon 'appA-deps'.
Do you want to apply this setting? (y/n)
Enabling add-on 'appA-deps'.
Do you want to apply this setting? (y/n)