Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add bootstrap rake task for initializing a new dev environment.

  • Loading branch information...
commit b92a17f46f65e10c904b8437e588ad614f828413 1 parent 818c747
@jimmycuadra authored
Showing with 32 additions and 0 deletions.
  1. +16 −0 db/schema.rb
  2. +16 −0 lib/tasks/bootstrap.rake
View
16 db/schema.rb
@@ -0,0 +1,16 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 0) do
+
+end
View
16 lib/tasks/bootstrap.rake
@@ -0,0 +1,16 @@
+require "securerandom"
+
+namespace :bootstrap do
+ file "config/database.yml" => "config/database.yml.example" do |t|
+ sh "cp #{t.prerequisites.first} #{t.name}"
+ end
+
+ file ".env" do |t|
+ sh "echo 'SECRET_TOKEN=#{SecureRandom.hex(64)}' > .env"
+ end
+end
+
+desc "Prepare a fresh copy of the repository for development"
+task :bootstrap => ["config/database.yml", ".env"] do
+ Rake::Task["db:migrate"].invoke
+end
Please sign in to comment.
Something went wrong with that request. Please try again.