Moved cloud66 config out of .cloud66 into config/cloud/cloud66 it is way too prominent as the first folder in github

Amended documentation to point to it from the install guide in the alternative section
Removed callout from the ubuntu guide, as it is unrelated
This commit is contained in:
Sam Saffron
2013-10-15 22:31:57 +11:00
parent e2ae3f0b45
commit 20039860eb
16 changed files with 2 additions and 9 deletions

View File

@@ -0,0 +1,233 @@
production:
first_thing:
# 1. Permissions on postgres box
- source: /.cloud66/scripts/permissions.sh
destination: /tmp/scripts/permissions.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
after_postgresql:
# 2. Copy SQL image to PSQL server
- source: /pg_dumps/production-image.sql
destination: /tmp/images/production-image.sql
target: postgresql
apply_during: build_only
owner: postgres
after_checkout:
# 3. Copy Procfile
- source: /.cloud66/files/Procfile
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
target: rails
# 4. Copy redis settings
- source: /.cloud66/files/redis.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/redis.yml
target: rails
parse: false
# 5. Copy production.rb file
- source: /.cloud66/files/production.rb
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/environments/production.rb
target: rails
# 6. Move thin config to server
- source: /.cloud66/files/thin.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
target: rails
after_rails:
# 7. Set environment variables and allow PSQL user to access them
- source: /.cloud66/scripts/env_vars.sh
destination: /tmp/scripts/env_vars.sh
target: rails
apply_during: build_only
execute: true
sudo: true
last_thing:
# 8. KILL DB
- source: /.cloud66/scripts/kill_db.sh
destination: /tmp/scripts/kill_db.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
# 9. DB:DROP & DB:CREATE
- source: /.cloud66/scripts/drop_create.sh
destination: /tmp/scripts/drop_create.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 10. Import database image
- source: /.cloud66/scripts/import_prod.sh
destination: /tmp/scripts/import_prod.sh
target: postgresql
apply_during: build_only
execute: true
owner: postgres
run_as: postgres
# 11. Migrate database
- source: /.cloud66/scripts/migrate.sh
destination: /tmp/migrate.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 12. Curl script
- source: /.cloud66/scripts/curl.sh
destination: /tmp/curl.sh
target: rails
apply_during: build_only
execute: true
sudo: true
staging:
first_thing:
# 1. Permissions on postgres box
- source: /.cloud66/scripts/permissions.sh
destination: /tmp/scripts/permissions.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
after_postgresql:
# 2. Copy SQL image to PSQL server
- source: /pg_dumps/production-image.sql
destination: /tmp/images/production-image.sql
target: postgresql
apply_during: build_only
owner: postgres
after_checkout:
# 3. Copy Procfile
- source: /.cloud66/files/Procfile
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
target: rails
# 4. Rename redis.yml.sample file
- source: /.cloud66/files/redis.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/redis.yml
target: rails
parse: false
# 5. Rename production.rb.sample file
- source: /.cloud66/files/production.rb
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/environments/production.rb
target: rails
# 6. Move thin config to server
- source: /.cloud66/files/thin.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
target: rails
after_rails:
# 7. Set environment variables and allow PSQL user to access them
- source: /.cloud66/scripts/env_vars.sh
destination: /tmp/scripts/env_vars.sh
target: rails
apply_during: build_only
execute: true
sudo: true
last_thing:
# 8. KILL DB
- source: /.cloud66/scripts/kill_db.sh
destination: /tmp/scripts/kill_db.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
# 9. DB:DROP & DB:CREATE
- source: /.cloud66/scripts/drop_create.sh
destination: /tmp/scripts/drop_create.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 10. Import database image
- source: /.cloud66/scripts/import_prod.sh
destination: /tmp/scripts/import_prod.sh
target: postgresql
apply_during: build_only
execute: true
owner: postgres
run_as: postgres
# 11. Migrate database
- source: /.cloud66/scripts/migrate.sh
destination: /tmp/migrate.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 12. Curl script
- source: /.cloud66/scripts/curl.sh
destination: /tmp/curl.sh
target: rails
apply_during: build_only
execute: true
sudo: true
development:
first_thing:
# 1. Permissions on postgres box
- source: /.cloud66/scripts/permissions.sh
destination: /tmp/scripts/permissions.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
after_postgresql:
# 2. Copy SQL image to PSQL server
- source: /pg_dumps/development-image.sql
destination: /tmp/images/development-image.sql
target: postgresql
apply_during: build_only
owner: postgres
after_checkout:
# 3. Copy Procfile
- source: /.cloud66/files/Procfile
destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
target: rails
# 4. Rename redis.yml.sample file
- source: /.cloud66/files/redis.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/redis.yml
target: rails
parse: false
# 5. Move thin config to server
- source: /.cloud66/files/thin.yml
destination: <%= ENV['RAILS_STACK_PATH'] %>/config/thin.yml
target: rails
after_rails:
# 6. Set environment variables and allow PSQL user to access them
- source: /.cloud66/scripts/env_vars.sh
destination: /tmp/scripts/env_vars.sh
target: rails
apply_during: build_only
execute: true
sudo: true
last_thing:
# 7. KILL DB
- source: /.cloud66/scripts/kill_db.sh
destination: /tmp/scripts/kill_db.sh
target: postgresql
apply_during: build_only
execute: true
sudo: true
# 8. DB:DROP & DB:CREATE
- source: /.cloud66/scripts/drop_create.sh
destination: /tmp/scripts/drop_create.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 9. Import database image
- source: /.cloud66/scripts/import_dev.sh
destination: /tmp/scripts/import_dev.sh
target: postgresql
apply_during: build_only
execute: true
owner: postgres
run_as: postgres
# 10. Migrate database
- source: /.cloud66/scripts/migrate.sh
destination: /tmp/migrate.sh
target: rails
apply_during: build_only
execute: true
sudo: true
# 11. Curl script
- source: /.cloud66/scripts/curl.sh
destination: /tmp/curl.sh
target: rails
apply_during: build_only
execute: true
sudo: true

View File

@@ -0,0 +1,3 @@
web: bundle exec rails server -p $PORT
sidekiq: bundle exec sidekiq -e $RAILS_ENV
custom_web: bundle exec thin start -C config/thin.yml -e $RACK_ENV -d

View File

@@ -0,0 +1,69 @@
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# stuff should be pre-compiled
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# you may use other configuration here for mail eg: sendgrid
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => ENV['SMTP_ADDRESS'],
:port => ENV['SMTP_PORT'],
:domain => ENV['SMTP_DOMAIN'],
:user_name => ENV['SMTP_USERNAME'],
:password => ENV['SMTP_PASSWORD'],
:authentication => 'plain',
:enable_starttls_auto => true }
#config.action_mailer.delivery_method = :sendmail
#config.action_mailer.sendmail_settings = {arguments: '-i'}
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
# this will cause all handlebars templates to be pre-compiles, making your page faster
config.handlebars.precompile = true
# this setting enables rack_cache so it caches various requests in redis
config.enable_rack_cache = true
# allows admins to use mini profiler
config.enable_mini_profiler = true
# allows Cross-origin resource sharing (CORS) for API access in JavaScript (default to false for security).
# See the initializer and https://github.com/cyu/rack-cors for configuration documentation.
#
# config.enable_rack_cors = false
# config.rack_cors_origins = ['*']
# config.rack_cors_resource = ['*', { :headers => :any, :methods => [:get, :post, :options] }]
# Discourse strongly recommend you use a CDN.
# For origin pull cdns all you need to do is register an account and configure
# config.action_controller.asset_host = "http://YOUR_CDN_HERE"
end

View File

@@ -0,0 +1,23 @@
defaults: &defaults
uri: <%= uri = URI.parse( ENV['REDIS_ADDRESS'].nil? ? ENV['REDIS_PROVIDER_URL'] || "redis://localhost:6379" : "redis://#{ENV['REDIS_ADDRESS']}:6379") %>
host: <%= uri.host %>
port: <%= uri.port %>
password: <%= uri.password %>
db: 0
cache_db: 2
development:
<<: *defaults
profile:
<<: *defaults
test:
<<: *defaults
db: 1
staging:
<<: *defaults
production:
<<: *defaults

View File

@@ -0,0 +1,13 @@
address: localhost
port: 3000
timeout: 30
pid: /tmp/web_server.pid
socket: /tmp/web_server.sock
max_conns: 1024
max_persistent_conns: 100
require: []
wait: 30
daemonize: true
chdir: $STACK_PATH
environment: $RAILS_ENV
log: $STACK_PATH/log/thin.log

View File

@@ -0,0 +1,19 @@
production:
rails:
server:
unique_name: frontend
configuration:
ignore_missing_schema: true
staging:
rails:
server:
unique_name: frontend
configuration:
ignore_missing_schema: true
development:
rails:
server:
unique_name: frontend
configuration:
use_asset_pipeline: false
ignore_missing_schema: true

View File

@@ -0,0 +1,14 @@
#!/bin/bash
FILE=/tmp/curl_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
curl localhost
curl localhost
curl localhost
curl localhost
curl localhost
touch /tmp/curl_done
fi

View File

@@ -0,0 +1,11 @@
#!/bin/bash
FILE=/tmp/drop_create_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
cd $RAILS_STACK_PATH
bundle exec rake db:drop db:create
touch /tmp/drop_create_done
fi

View File

@@ -0,0 +1,2 @@
#!/bin/bash
source /var/.cloud66_env

View File

@@ -0,0 +1,10 @@
#!/bin/bash
FILE=/tmp/import_dev_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
psql $POSTGRESQL_DATABASE < /tmp/images/development-image.sql
touch /tmp/import_dev_done
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
FILE=/tmp/import_prod_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
psql $POSTGRESQL_DATABASE < /tmp/images/production-image.sql
touch /tmp/import_prod_done
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
FILE=/tmp/kill_db_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
ps xa | grep postgres: | grep $POSTGRESQL_DATABASE | grep -v grep | awk '{print $1}' | sudo xargs kill
touch /tmp/kill_db_done
fi

View File

@@ -0,0 +1,11 @@
#!/bin/bash
FILE=/tmp/migrate_done
if [ -f $FILE ]
then
echo "File $FILE exists..."
else
cd $RAILS_STACK_PATH
bundle exec rake db:migrate db:seed_fu
touch /tmp/migrate_done
fi

View File

@@ -0,0 +1,2 @@
#!/bin/bash
sudo chmod 0644 -R /var/.cloud66_env