forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philip Kallberg
committed
Oct 14, 2013
1 parent
d80f4fa
commit 108d5e5
Showing
16 changed files
with
455 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.