This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#ssh -t emerald@emerald-beta.scottishgreens.org.uk "/srv/emerald/bin/deploy.sh" | |
DEPLOY_USER="root" | |
APP_NAME="emerald" | |
ENV_FILE="../src/.env.production" | |
DEPENDS="-d nodejs" | |
EXCLUDES="-x .git -x *.log" | |
VERSION="-v $(git rev-parse --short HEAD)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fields"> | |
<p> | |
<div class="input string optional challenge_questions_1391526042286_answers_answer"><input class="string optional" id="challenge_questions_attributes_1391526042286_answers_attributes_new_answers_answer" name="challenge[questions_attributes][1391526042286][answers_attributes][new_answers][answer]" placeholder="Answer" type="text" /></div> | |
<div class="input boolean optional challenge_questions_1391526042286_answers_correct"><input name="challenge[questions_attributes][1391526042286][answers_attributes][new_answers][correct]" type="hidden" value="0" /><label class="boolean optional control-label checkbox" for="challenge_questions_attributes_1391526042286_answers_attributes_new_answers_correct"><input class="boolean optional" id="challenge_questions_attributes_1391526042286_answers_attributes_new_answers_correct" name="challenge[questions_attributes][1391526042286][answers_attributes][new_answers][correct]" type="checkbox" value="1" />Correct</label></div> | |
<input id="challen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'apartment/elevators/subdomain' | |
Apartment.configure do |config| | |
config.excluded_models = %w{Account} | |
config.use_schemas = true | |
config.tenant_names = lambda{ Account.pluck :database } | |
end | |
Rails.application.config.middleware.use 'Apartment::Elevators::Subdomain' | |
require 'apartment/tasks/enhancements' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category < ActiveRecord::Base | |
default_scope { order('name ASC') } | |
has_ancestry | |
validates :name, :presence => true | |
has_many :paths | |
has_many :texts | |
has_many :widgets | |
has_many :icons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake' | |
require 'apartment/elevators/subdomain' | |
# | |
# Apartment Configuration | |
# | |
Apartment.configure do |config| | |
config.excluded_models = ['School', 'Path', 'Icon', 'IconFile', 'Category', 'Text', 'Widget', 'Swatch'] | |
config.use_schemas = true | |
config.persistent_schemas = ['hstore', 'uuid'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
badgemaker=# \dn | |
List of schemas | |
Name | Owner | |
--------+---------- | |
hstore | john | |
public | postgres | |
uuid | john | |
(3 rows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: corporate | |
user: deploy | |
sudo: true | |
tasks: | |
- name: Install Gem Prerequisites | |
apt: pkg={{ item }} state=installed | |
with_items: | |
- libpq-dev | |
- nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ssh-copy-id -i ~/.ssh/id_rsa.pub root@$HOST | |
As root: | |
adduser --gecos "" deploy | |
usermod -a -G sudo deploy | |
export TERM=xterm | |
visudo: | |
%sudo ALL=(ALL) NOPASSWD: ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: postgresql | |
encoding: unicode | |
schema_search_path: "public,shared_extensions" | |
host: <%= ENV['DATABASE_HOST'] %> | |
database: <%= ENV['DATABASE_NAME'] %> | |
pool: 5 | |
username: <%= ENV['DATABASE_USER'] %> | |
password: <%= ENV['DATABASE_PASSWORD'] %> |
OlderNewer