From b466788bcccf8968fa0ecfeaff3a06dc1485aa20 Mon Sep 17 00:00:00 2001 From: Andrew Cantino Date: Sun, 28 Sep 2014 14:17:40 -0700 Subject: [PATCH] .openshift directory --- .openshift/action_hooks/build | 5 ++++ .openshift/action_hooks/deploy | 9 ++++++ .openshift/action_hooks/post_deploy | 4 +++ .openshift/action_hooks/post_start_ruby-2.0 | 15 ++++++++++ .openshift/action_hooks/post_stop_ruby-2.0 | 14 +++++++++ .openshift/action_hooks/pre_build | 22 ++++++++++++++ .openshift/action_hooks/pre_start_ruby-2.0 | 33 +++++++++++++++++++++ .openshift/action_hooks/pre_stop_ruby-2.0 | 14 +++++++++ .openshift/cron/README.cron | 22 ++++++++++++++ .openshift/cron/daily/.gitignore | 0 .openshift/cron/hourly/.gitignore | 0 .openshift/cron/minutely/.gitignore | 0 .openshift/cron/monthly/.gitignore | 0 .openshift/cron/weekly/README | 16 ++++++++++ .openshift/cron/weekly/chrono.dat | 1 + .openshift/cron/weekly/chronograph | 3 ++ .openshift/cron/weekly/jobs.allow | 12 ++++++++ .openshift/cron/weekly/jobs.deny | 7 +++++ .openshift/markers/README | 8 +++++ 19 files changed, 185 insertions(+) create mode 100755 .openshift/action_hooks/build create mode 100755 .openshift/action_hooks/deploy create mode 100755 .openshift/action_hooks/post_deploy create mode 100755 .openshift/action_hooks/post_start_ruby-2.0 create mode 100755 .openshift/action_hooks/post_stop_ruby-2.0 create mode 100755 .openshift/action_hooks/pre_build create mode 100755 .openshift/action_hooks/pre_start_ruby-2.0 create mode 100755 .openshift/action_hooks/pre_stop_ruby-2.0 create mode 100644 .openshift/cron/README.cron create mode 100644 .openshift/cron/daily/.gitignore create mode 100644 .openshift/cron/hourly/.gitignore create mode 100644 .openshift/cron/minutely/.gitignore create mode 100644 .openshift/cron/monthly/.gitignore create mode 100644 .openshift/cron/weekly/README create mode 100644 .openshift/cron/weekly/chrono.dat create mode 100755 .openshift/cron/weekly/chronograph create mode 100644 .openshift/cron/weekly/jobs.allow create mode 100644 .openshift/cron/weekly/jobs.deny create mode 100644 .openshift/markers/README diff --git a/.openshift/action_hooks/build b/.openshift/action_hooks/build new file mode 100755 index 00000000..4f5dfda2 --- /dev/null +++ b/.openshift/action_hooks/build @@ -0,0 +1,5 @@ +#!/bin/bash +# This is a simple build script and will be executed on your CI system if +# available. Otherwise it will execute while your application is stopped +# before the deploy step. This script gets executed directly, so it +# could be python, php, ruby, etc. diff --git a/.openshift/action_hooks/deploy b/.openshift/action_hooks/deploy new file mode 100755 index 00000000..3f32bf25 --- /dev/null +++ b/.openshift/action_hooks/deploy @@ -0,0 +1,9 @@ +#!/bin/bash +# This deploy hook gets executed after dependencies are resolved and the +# build hook has been run but before the application has been started back +# up again. This script gets executed directly, so it could be python, php, +# ruby, etc. + +pushd ${OPENSHIFT_REPO_DIR} > /dev/null +RAILS_ENV="production" bundle exec rake db:migrate +popd > /dev/null diff --git a/.openshift/action_hooks/post_deploy b/.openshift/action_hooks/post_deploy new file mode 100755 index 00000000..f0fc2653 --- /dev/null +++ b/.openshift/action_hooks/post_deploy @@ -0,0 +1,4 @@ +#!/bin/bash +# This is a simple post deploy hook executed after your application +# is deployed and started. This script gets executed directly, so +# it could be python, php, ruby, etc. diff --git a/.openshift/action_hooks/post_start_ruby-2.0 b/.openshift/action_hooks/post_start_ruby-2.0 new file mode 100755 index 00000000..803ced4b --- /dev/null +++ b/.openshift/action_hooks/post_start_ruby-2.0 @@ -0,0 +1,15 @@ +#!/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. + diff --git a/.openshift/action_hooks/post_stop_ruby-2.0 b/.openshift/action_hooks/post_stop_ruby-2.0 new file mode 100755 index 00000000..ff0debda --- /dev/null +++ b/.openshift/action_hooks/post_stop_ruby-2.0 @@ -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. diff --git a/.openshift/action_hooks/pre_build b/.openshift/action_hooks/pre_build new file mode 100755 index 00000000..c904e883 --- /dev/null +++ b/.openshift/action_hooks/pre_build @@ -0,0 +1,22 @@ +#!/bin/bash +# This is a simple script and will be executed on your CI system if +# available. Otherwise it will execute while your application is stopped +# before the build step. This script gets executed directly, so it +# could be python, php, ruby, etc. + +STORED_ASSETS="${OPENSHIFT_DATA_DIR}/assets" +LIVE_ASSETS="${OPENSHIFT_REPO_DIR}/public/assets" + +# Ensure our stored assets directory exists +if [ ! -d "${STORED_ASSETS}" ]; then + echo " Creating permanent assets directory" + mkdir "${STORED_ASSETS}" +fi + +# Create symlink to stored assets unless we're uploading our own assets +if [ -d "${LIVE_ASSETS}" ]; then + echo " WARNING: Assets included in git repository, not using stored assets" +else + echo " Restoring stored assets" + ln -s "${STORED_ASSETS}" "${LIVE_ASSETS}" +fi diff --git a/.openshift/action_hooks/pre_start_ruby-2.0 b/.openshift/action_hooks/pre_start_ruby-2.0 new file mode 100755 index 00000000..1d0343fb --- /dev/null +++ b/.openshift/action_hooks/pre_start_ruby-2.0 @@ -0,0 +1,33 @@ +#!/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. + +if [ -f ${OPENSHIFT_REPO_DIR}/.env.example ] +then + grep = ${OPENSHIFT_REPO_DIR}/.env.example | sed -e 's/^#[^ ]//' | grep -v -e '^#' | cut -d= -f1 | \ + while read var ; do + eval "echo \"$var=\\\"\${$var:-\$$var}\\\"\"" + done | grep -v -e ^= > ${OPENSHIFT_REPO_DIR}/.env + + chmod ugo+r ${OPENSHIFT_REPO_DIR}/.env + source ${OPENSHIFT_REPO_DIR}/.env +else + cat <