Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

action hook updates

  • Loading branch information...
commit 388a07bcdbe8dfc164625f5036734e8c83bffc46 1 parent 3c17c62
@danmcp danmcp authored
View
1  .gitignore
@@ -0,0 +1 @@
+.project
View
81 .openshift/action_hooks/build
@@ -1,78 +1,5 @@
#!/bin/bash
-# This is a simple build script, place your post-deploy but pre-start commands
-# in this script. This script gets executed directly, so it could be python,
-# php, ruby, etc.
-
-# Edit the below values, the only required change is DOMAIN_NAME
-# These values are _ONLY_ used at install time.
-DOMAIN_NAME="$OPENSHIFT_APP_DNS" # This is required to be set
-DATABASE_NAME="$OPENSHIFT_APP_NAME"
-DATABASE_TYPE="mysql"
-REVIEWBOARD_ADMIN="admin"
-REVIEWBOARD_ADMIN_PASSWORD="OpenShiftAdmin" # Used only at install time
-REVIEWBOARD_ADMIN_EMAIL="example@example.com"
-export PYTHON_EGG_CACHE="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME/tmp/egg_cache"
-export PATH=$PATH:~/$OPENSHIFT_APP_NAME/virtenv/bin/
-
-set -e
-
-if [ $DOMAIN_NAME == "CHANGEME" ]
-then
- echo 1>&2
- echo 1>&2
- echo "IMPORTANT !! IMPORTANT !! IMPORTANT !!" 1>&2
- echo "DOMAIN_NAME is not set! Please edit this file in your git repo:" 1>&2
- echo " .openshift/action_hooks/build"
- echo "Change DOMAIN_NAME to whatever your \$app-\$username.rhcloud.com domain is" 1>&2
- echo 1>&2
- echo 1>&2
- exit 9
-fi
-
-if [ -z $OPENSHIFT_DB_HOST ]
-then
- echo 1>&2
- echo 1>&2
- echo "Could not find mysql database. Please run:" 1>&2
- echo "rhc-ctl-app -a $OPENSHIFT_APP_NAME -e add-mysql-5.1" 1>&2
- echo "then make a sample commit (add whitespace somewhere) and re-push" 1>&2
- echo 1>&2
- echo 1>&2
- exit 5
-fi
-
-# Install or upgrade
-if [ -d $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME ]
-then
- rb-site upgrade --noinput $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME/
-else
- rb-site install --domain-name="$DOMAIN_NAME" \
- --db-name="$DATABASE_NAME" \
- --db-type="$DATABASE_TYPE" \
- --db-host="$OPENSHIFT_DB_HOST" \
- --db-user="$OPENSHIFT_DB_USERNAME" \
- --db-pass="$OPENSHIFT_DB_PASSWORD" \
- --site-root="/" \
- --media-url="static/media/" \
- --admin-user="$REVIEWBOARD_ADMIN" \
- --admin-password="$REVIEWBOARD_ADMIN_PASSWORD" \
- --admin-email="$REVIEWBOARD_ADMIN_EMAIL" \
- --web-server-type="apache" \
- --python-loader=wsgi \
- --cache-type="file" \
- --cache-info="file:///tmp/reviewboard_cache" \
- --noinput $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME/
-
- echo 1>&2
- echo 1>&2
- echo "ReviewBoard installation complete! You may now log in to https://$DOMAIN_NAME/" 1>&2
- echo "ReviewBoard Admin Username: $REVIEWBOARD_ADMIN" 1>&2
- echo "ReviewBoard Admin Password: $REVIEWBOARD_ADMIN_PASSWORD" 1>&2
- echo "Don't forget to change your password from the default!" 1>&2
- echo 1>&2
- echo 1>&2
-fi
-
-# Setup symlinks to properly display static content
-ln -s ../../../data/$OPENSHIFT_APP_NAME/htdocs/media/ $OPENSHIFT_REPO_DIR/wsgi/static/media
-ln -s ../../../data/$OPENSHIFT_APP_NAME/htdocs/errordocs/ $OPENSHIFT_REPO_DIR/wsgi/static/errordocs
+# 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.
View
5 .openshift/action_hooks/deploy
@@ -0,0 +1,5 @@
+#!/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.
View
78 .openshift/action_hooks/post_deploy
@@ -0,0 +1,78 @@
+#!/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.
+
+# Edit the below values, the only required change is DOMAIN_NAME
+# These values are _ONLY_ used at install time.
+DOMAIN_NAME="$OPENSHIFT_APP_DNS" # This is required to be set
+DATABASE_NAME="$OPENSHIFT_APP_NAME"
+DATABASE_TYPE="mysql"
+REVIEWBOARD_ADMIN="admin"
+REVIEWBOARD_ADMIN_PASSWORD="OpenShiftAdmin" # Used only at install time
+REVIEWBOARD_ADMIN_EMAIL="example@example.com"
+export PYTHON_EGG_CACHE="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME/tmp/egg_cache"
+export PATH=$PATH:~/$OPENSHIFT_APP_NAME/virtenv/bin/
+
+set -e
+
+if [ $DOMAIN_NAME == "CHANGEME" ]
+then
+ echo 1>&2
+ echo 1>&2
+ echo "IMPORTANT !! IMPORTANT !! IMPORTANT !!" 1>&2
+ echo "DOMAIN_NAME is not set! Please edit this file in your git repo:" 1>&2
+ echo " .openshift/action_hooks/build"
+ echo "Change DOMAIN_NAME to whatever your \$app-\$username.rhcloud.com domain is" 1>&2
+ echo 1>&2
+ echo 1>&2
+ exit 9
+fi
+
+if [ -z $OPENSHIFT_DB_HOST ]
+then
+ echo 1>&2
+ echo 1>&2
+ echo "Could not find mysql database. Please run:" 1>&2
+ echo "rhc-ctl-app -a $OPENSHIFT_APP_NAME -e add-mysql-5.1" 1>&2
+ echo "then make a sample commit (add whitespace somewhere) and re-push" 1>&2
+ echo 1>&2
+ echo 1>&2
+ exit 5
+fi
+
+# Install or upgrade
+if [ -d $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME ]
+then
+ rb-site upgrade --noinput $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME/
+else
+ rb-site install --domain-name="$DOMAIN_NAME" \
+ --db-name="$DATABASE_NAME" \
+ --db-type="$DATABASE_TYPE" \
+ --db-host="$OPENSHIFT_DB_HOST" \
+ --db-user="$OPENSHIFT_DB_USERNAME" \
+ --db-pass="$OPENSHIFT_DB_PASSWORD" \
+ --site-root="/" \
+ --media-url="static/media/" \
+ --admin-user="$REVIEWBOARD_ADMIN" \
+ --admin-password="$REVIEWBOARD_ADMIN_PASSWORD" \
+ --admin-email="$REVIEWBOARD_ADMIN_EMAIL" \
+ --web-server-type="apache" \
+ --python-loader=wsgi \
+ --cache-type="file" \
+ --cache-info="file:///tmp/reviewboard_cache" \
+ --noinput $OPENSHIFT_DATA_DIR$OPENSHIFT_APP_NAME/
+
+ echo 1>&2
+ echo 1>&2
+ echo "ReviewBoard installation complete! You may now log in to https://$DOMAIN_NAME/" 1>&2
+ echo "ReviewBoard Admin Username: $REVIEWBOARD_ADMIN" 1>&2
+ echo "ReviewBoard Admin Password: $REVIEWBOARD_ADMIN_PASSWORD" 1>&2
+ echo "Don't forget to change your password from the default!" 1>&2
+ echo 1>&2
+ echo 1>&2
+fi
+
+# Setup symlinks to properly display static content
+ln -s ../../../data/$OPENSHIFT_APP_NAME/htdocs/media/ $OPENSHIFT_REPO_DIR/wsgi/static/media
+ln -s ../../../data/$OPENSHIFT_APP_NAME/htdocs/errordocs/ $OPENSHIFT_REPO_DIR/wsgi/static/errordocs
View
5 .openshift/action_hooks/pre_build
@@ -0,0 +1,5 @@
+#!/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.
Please sign in to comment.
Something went wrong with that request. Please try again.