Skip to content

Commit

Permalink
Change plugin setup to more closely match core setup
Browse files Browse the repository at this point in the history
- Honor the SKIP_DATABASE_RESET env var and default to true on CI
- ensure_config_files before bundler setup
  • Loading branch information
Fryguy committed Jul 21, 2023
1 parent ce5d9f3 commit 86826d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/manageiq/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ def self.manageiq_plugin_update(plugin_root = nil, force_bundle_update: true)
# determine plugin root dir. Assume we are called from a 'bin/' script in the plugin root
plugin_root ||= Pathname.new(caller_locations.last.absolute_path).dirname.parent

ENV["SKIP_DATABASE_RESET"] ||= ENV["CI"] ? "true" : "false"

ensure_config_files

puts "== Installing dependencies =="
setup_gemfile_lock if ENV["CI"]
install_bundler(plugin_root)
bundle_config(plugin_root)
bundle_update(plugin_root, force: force_bundle_update)

ensure_config_files

unless ENV["CI"]
if ENV["SKIP_DATABASE_RESET"] == "false"
# Update the local development database
create_database(plugin_root)
migrate_database(plugin_root)
Expand Down

0 comments on commit 86826d9

Please sign in to comment.