aboutsummaryrefslogtreecommitdiffstats
path: root/bin/setup
diff options
context:
space:
mode:
authorTeddy Wing2015-01-23 17:29:27 -0500
committerTeddy Wing2015-01-23 17:29:27 -0500
commitd7d88ccd11cda59619fea44e14997ed21b5f9a4e (patch)
tree98d11e9d5d8f959d3fd3b1a277a87b98e51e042f /bin/setup
downloadNotes-angular-demo-d7d88ccd11cda59619fea44e14997ed21b5f9a4e.tar.bz2
Initial commit. Base Rails 4.2.0 project.
Diffstat (limited to 'bin/setup')
-rwxr-xr-xbin/setup29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/setup b/bin/setup
new file mode 100755
index 0000000..acdb2c1
--- /dev/null
+++ b/bin/setup
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end