From 03b18410071f4e8a9a2daff13e02881e5f1a1c12 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 17 Sep 2018 17:48:32 -0700 Subject: Add dummy app for testing --- test/dummy/bin/update | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 test/dummy/bin/update (limited to 'test/dummy/bin/update') diff --git a/test/dummy/bin/update b/test/dummy/bin/update new file mode 100755 index 0000000000..58bfaed518 --- /dev/null +++ b/test/dummy/bin/update @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end -- cgit v1.2.3