diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/ci | 6 | ||||
| -rwxr-xr-x | bin/dev | 2 | ||||
| -rwxr-xr-x | bin/rails | 6 | ||||
| -rwxr-xr-x | bin/rake | 4 | ||||
| -rwxr-xr-x | bin/setup | 34 |
5 files changed, 33 insertions, 19 deletions
| @@ -0,0 +1,6 @@ | |||
| 1 | #!/usr/bin/env ruby | ||
| 2 | require_relative "../config/boot" | ||
| 3 | require "active_support/continuous_integration" | ||
| 4 | |||
| 5 | CI = ActiveSupport::ContinuousIntegration | ||
| 6 | require_relative "../config/ci.rb" | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | #!/usr/bin/env ruby | ||
| 2 | exec "./bin/rails", "server", *ARGV | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
| 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) | 2 | APP_PATH = File.expand_path("../config/application", __dir__) |
| 3 | require_relative '../config/boot' | 3 | require_relative "../config/boot" |
| 4 | require 'rails/commands' | 4 | require "rails/commands" |
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
| 2 | require_relative '../config/boot' | 2 | require_relative "../config/boot" |
| 3 | require 'rake' | 3 | require "rake" |
| 4 | Rake.application.run | 4 | Rake.application.run |
| @@ -1,29 +1,35 @@ | |||
| 1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
| 2 | require 'pathname' | 2 | require "fileutils" |
| 3 | 3 | ||
| 4 | # path to your application root. | 4 | APP_ROOT = File.expand_path("..", __dir__) |
| 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
| 6 | 5 | ||
| 7 | Dir.chdir APP_ROOT do | 6 | def system!(*args) |
| 8 | # This script is a starting point to setup your application. | 7 | system(*args, exception: true) |
| 9 | # Add necessary setup steps to this file: | 8 | end |
| 9 | |||
| 10 | FileUtils.chdir APP_ROOT do | ||
| 11 | # This script is a way to set up or update your development environment automatically. | ||
| 12 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. | ||
| 13 | # Add necessary setup steps to this file. | ||
| 10 | 14 | ||
| 11 | puts "== Installing dependencies ==" | 15 | puts "== Installing dependencies ==" |
| 12 | system "gem install bundler --conservative" | 16 | system("bundle check") || system!("bundle install") |
| 13 | system "bundle check || bundle install" | ||
| 14 | 17 | ||
| 15 | # puts "\n== Copying sample files ==" | 18 | # puts "\n== Copying sample files ==" |
| 16 | # unless File.exist?("config/database.yml") | 19 | # unless File.exist?("config/database.yml") |
| 17 | # system "cp config/database.yml.sample config/database.yml" | 20 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" |
| 18 | # end | 21 | # end |
| 19 | 22 | ||
| 20 | puts "\n== Preparing database ==" | 23 | puts "\n== Preparing database ==" |
| 21 | system "bin/rake db:setup" | 24 | system! "bin/rails db:prepare" |
| 25 | system! "bin/rails db:reset" if ARGV.include?("--reset") | ||
| 22 | 26 | ||
| 23 | puts "\n== Removing old logs and tempfiles ==" | 27 | puts "\n== Removing old logs and tempfiles ==" |
| 24 | system "rm -f log/*" | 28 | system! "bin/rails log:clear tmp:clear" |
| 25 | system "rm -rf tmp/cache" | ||
| 26 | 29 | ||
| 27 | puts "\n== Restarting application server ==" | 30 | unless ARGV.include?("--skip-server") |
| 28 | system "touch tmp/restart.txt" | 31 | puts "\n== Starting development server ==" |
| 32 | STDOUT.flush # flush the output before exec(2) so that it displays | ||
| 33 | exec "bin/dev" | ||
| 34 | end | ||
| 29 | end | 35 | end |
