Permalink
Browse files

Fixup variables for dev/typeless and update the app with the pre/post

start/stop action_hooks.
  • Loading branch information...
1 parent 2b17250 commit cc1f8b7b2f0145bf0c36135fb274bd1ab68d3417 Ram Ranganathan committed Oct 8, 2012
@@ -7,4 +7,4 @@
# Run db:migrate
pushd ${OPENSHIFT_REPO_DIR} > /dev/null
bundle exec rake db:migrate RAILS_ENV="production"
-popd > /dev/null
+popd > /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# The pre_start_cartridge and pre_stop_cartridge hooks are *SOURCED*
+# immediately before (re)starting or stopping the specified cartridge.
+# They are able to make any desired environment variable changes as
+# well as other adjustments to the application environment.
+
+# The post_start_cartridge and post_stop_cartridge hooks are executed
+# immediately after (re)starting or stopping the specified cartridge.
+
+# Exercise caution when adding commands to these hooks. They can
+# prevent your application from stopping cleanly or starting at all.
+# Application start and stop is subject to different timeouts
+# throughout the system.
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# The pre_start_cartridge and pre_stop_cartridge hooks are *SOURCED*
+# immediately before (re)starting or stopping the specified cartridge.
+# They are able to make any desired environment variable changes as
+# well as other adjustments to the application environment.
+
+# The post_start_cartridge and post_stop_cartridge hooks are executed
+# immediately after (re)starting or stopping the specified cartridge.
+
+# Exercise caution when adding commands to these hooks. They can
+# prevent your application from stopping cleanly or starting at all.
+# Application start and stop is subject to different timeouts
+# throughout the system.
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# The pre_start_cartridge and pre_stop_cartridge hooks are *SOURCED*
+# immediately before (re)starting or stopping the specified cartridge.
+# They are able to make any desired environment variable changes as
+# well as other adjustments to the application environment.
+
+# The post_start_cartridge and post_stop_cartridge hooks are executed
+# immediately after (re)starting or stopping the specified cartridge.
+
+# Exercise caution when adding commands to these hooks. They can
+# prevent your application from stopping cleanly or starting at all.
+# Application start and stop is subject to different timeouts
+# throughout the system.
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# The pre_start_cartridge and pre_stop_cartridge hooks are *SOURCED*
+# immediately before (re)starting or stopping the specified cartridge.
+# They are able to make any desired environment variable changes as
+# well as other adjustments to the application environment.
+
+# The post_start_cartridge and post_stop_cartridge hooks are executed
+# immediately after (re)starting or stopping the specified cartridge.
+
+# Exercise caution when adding commands to these hooks. They can
+# prevent your application from stopping cleanly or starting at all.
+# Application start and stop is subject to different timeouts
+# throughout the system.
@@ -5,4 +5,4 @@ Adding marker files to this directory will have the following effects:
force_clean_build - Previous output from bundle install --deployment will be
removed and all gems will be reinstalled according to the current
- Gemfile/Gemfile.lock.
+ Gemfile/Gemfile.lock.
View
14 README
@@ -34,18 +34,16 @@ Environment Variables
OpenShift Express provides several environment variables to reference for ease
of use. The following list are some common variables but far from exhaustive:
- ENV['OPENSHIFT_GEAR_NAME'] - Application name
- ENV['OPENSHIFT_GEAR_DIR'] - Application dir
ENV['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
ENV['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
-When embedding a database using 'rhc app cartridge add', you can reference environment
-variables for username, host and password:
+When embedding a database using 'rhc app cartridge add', you can reference
+environment variables for username, host and password. Example for mysql:
- ENV['OPENSHIFT_DB_HOST'] - DB host
- ENV['OPENSHIFT_DB_PORT'] - DB Port
- ENV['OPENSHIFT_DB_USERNAME'] - DB Username
- ENV['OPENSHIFT_DB_PASSWORD'] - DB Password
+ ENV['OPENSHIFT_MYSQL_DB_HOST'] - DB host
+ ENV['OPENSHIFT_MYSQL_DB_PORT'] - DB Port
+ ENV['OPENSHIFT_MYSQL_DB_USERNAME'] - DB Username
+ ENV['OPENSHIFT_MYSQL_DB_PASSWORD'] - DB Password
To get a full list of environment variables, simply add a line in your
.openshift/action_hooks/build script that says "export" and push.
View
@@ -1,2 +1,2 @@
require ::File.expand_path('../config/environment', __FILE__)
-run Juvia::Application
+run Juvia::Application
View
@@ -9,6 +9,6 @@ test:
production:
adapter: mysql2
database: <%= ENV['OPENSHIFT_APP_NAME'] %>
- host: <%= ENV['OPENSHIFT_DB_HOST'] %>
- username: <%= ENV['OPENSHIFT_DB_USERNAME'] %>
- password: <%= ENV['OPENSHIFT_DB_PASSWORD'] %>
+ host: <%= ENV['OPENSHIFT_MYSQL_DB_HOST'] %>
+ username: <%= ENV['OPENSHIFT_MYSQL_DB_USERNAME'] %>
+ password: <%= ENV['OPENSHIFT_MYSQL_DB_PASSWORD'] %>

0 comments on commit cc1f8b7

Please sign in to comment.