Sha256: 17eb8728f52ccb99f147f64a5a26932962a6eba35b926007d2644074c7a663cb

Contents?: true

Size: 1.14 KB

Versions: 21

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
  system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir APP_ROOT do
  # This script is a way to set up or update your development environment automatically.
  # This script is idempotent, so that you can run it at any time and get an expectable outcome.
  # Add necessary setup steps to this file.
  puts "== Installing dependencies =="
  cmd = "gem install bundler --conservative"
  puts "Executing #{cmd}"
  system! cmd
  system("bundle check") || system!("bundle install")

  puts "\n== Executing yarn =="
  system!("bin/yarn")

  puts "\n== Creating config/database.yml file =="
  if !ENV["DOCKER_ENV"]
    system! "rm -f config/database.yml"
    system! "cp config/database.yml.postgresql config/database.yml"
  end

  puts "\n== Executing rake setup =="
  system! "bundle exec rake setup"

  puts "\n== Removing logs and tempfiles =="
  system! "bin/rails log:clear tmp:clear"

  puts "\n== Restarting application server =="
  system! "bundle exec rails restart"
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
neeto-commons-backend-1.0.109 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.108 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.107 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.106 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.105 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.104 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.103 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.102 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.101 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.100 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.99 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.98 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.97 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.96 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.95 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.94 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.93 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.92 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.91 lib/neeto_commons_backend/common_files/bin/setup
neeto-commons-backend-1.0.90 lib/neeto_commons_backend/common_files/bin/setup