Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

action hook updates

  • Loading branch information...
commit 5552a11e189149fe60a5a2b3f9b169ea6836b13f 1 parent cbf3f37
@danmcp danmcp authored
View
1  .gitignore
@@ -0,0 +1 @@
+.project
View
35 .openshift/action_hooks/build
@@ -1,38 +1,11 @@
#!/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.
+# 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.
set -e
-if [ -z $OPENSHIFT_DB_HOST ]
-then
- 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
- exit 5
-fi
-
-# Confirm database exists, if not create it
-if ! /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" -e "select * from user;" "$OPENSHIFT_APP_NAME" > /dev/null
-then
- echo
- echo "Database schema not found, importing 'wolfcms.sql' schema."
- echo
- /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" "$OPENSHIFT_APP_NAME" < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/wolfcms.sql"
- echo
- echo "done."
- echo "=================================================="
- echo " WolfCMS-Admin login: admin "
- echo " WolfCMS-Admin password: 12bdcfb601K "
- echo " Don't forget to change your WolfCMS admin password!"
- echo "=================================================="
-else
- echo "Database found, skipping import."
-fi
-
chmod -v 0440 $OPENSHIFT_REPO_DIR/php/config.php
chmod -v 0440 $OPENSHIFT_REPO_DIR/php/index.php
chmod -v 0440 $OPENSHIFT_REPO_DIR/php/.htaccess
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
34 .openshift/action_hooks/post_deploy
@@ -0,0 +1,34 @@
+#!/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.
+
+set -e
+
+if [ -z $OPENSHIFT_DB_HOST ]
+then
+ 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
+ exit 5
+fi
+
+# Confirm database exists, if not create it
+if ! /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" -e "select * from user;" "$OPENSHIFT_APP_NAME" > /dev/null
+then
+ echo
+ echo "Database schema not found, importing 'wolfcms.sql' schema."
+ echo
+ /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" "$OPENSHIFT_APP_NAME" < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/wolfcms.sql"
+ echo
+ echo "done."
+ echo "=================================================="
+ echo " WolfCMS-Admin login: admin "
+ echo " WolfCMS-Admin password: 12bdcfb601K "
+ echo " Don't forget to change your WolfCMS admin password!"
+ echo "=================================================="
+else
+ echo "Database found, skipping import."
+fi
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.
View
4 README.md
@@ -34,8 +34,8 @@ Then push the repo upstream
That's it, you can now checkout your application at (default admin account is admin/admin):
- http://wolfcms-$your_domain.rhcloud.com
- http://wolfcms-$your_domain.rhcloud.com/admin for WolfCMS Administration
+ http://wolfcms-$yournamespace.rhcloud.com
+ http://wolfcms-$yournamespace.rhcloud.com/admin for WolfCMS Administration
Please sign in to comment.
Something went wrong with that request. Please try again.