Skip to content

Commit

Permalink
check for minikube for rake install
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Jul 15, 2021
1 parent 3b4fe55 commit 0098866
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ appSettings:
apiKey: <your_api_key>
EOF

# requires minikube to be installed and running
rake install

# OR
Expand Down
10 changes: 6 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,21 @@ end

task :client => "#{CLIENT_DIR}/Gemfile"

task :install => :client do
task :install do
build_type = get_var(:build_type, prompt: false, required: false, default: "development")
namespace = get_var(:namespace, prompt: false, required: false)
values_file = get_var(:values_file, prompt: false, required: false, default: "local/values.yaml")

system("minikube version", [:out, :err] => "/dev/null") || fail("dev dependency not installed - minikube")
system("minikube status", [:out, :err] => "/dev/null") || fail("dev dependency not running - minikube")

Rake::Task["client"].invoke

minikube_env = Hash[`minikube docker-env --shell bash`.scan(/([^ ]*)="(.*)"/)]
orig_env = ENV.to_hash
minikube_env.each {|k, v| ENV[k] = v }
begin
Rake::Task["build_#{build_type}"].invoke

ENV['IMAGE_NAME'] = "kubetruth"
Rake::Task["build_#{build_type}"].invoke
ensure
(minikube_env.keys - orig_env.keys).each {|k| ENV.delete(k) }
(minikube_env.keys & orig_env.keys).each {|k, v| ENV[k] = orig_env[k] }
Expand Down
2 changes: 1 addition & 1 deletion spec/kubetruth/kubeapi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def check_deps
@deps_checked ||= begin
system("helm version >/dev/null 2>&1") || fail("test dependency not installed - helm ")
system("minikube version >/dev/null 2>&1") || fail("test dependency not installed - minikube")
system("minikube status >/dev/null 2>&1") || fail("test dependency nor running - minikube")
system("minikube status >/dev/null 2>&1") || fail("test dependency not running - minikube")
true
end
end
Expand Down

0 comments on commit 0098866

Please sign in to comment.