Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Automated install script added, 'rvm-installer' repository urls fixed

A (very ugly) bash script is now the preferred way to install
rvm-openshift, as it automates the process of fetching, building and
installing a working version of libyaml-0.1.4 and then installing RVM
and Ruby 1.9.3 for you. I'm no bash guru so if you can improve the
script, please do!
  • Loading branch information...
commit 47c530b679844579a19813016dd540427ba89134 1 parent f194318
@xiy authored
View
26 README.md
@@ -0,0 +1,26 @@
+# RVM for RedHat OpenShift
+
+A customised version of RVM that uses the non-standard install locations and environment variables in use on the RedHat OpenShift service.
+
+## Installing
+
+ $ curl -L https://raw.github.com/xiy/rvm-openshift/master/binscripts/install-rvm-openshift.sh | bash -s
+
+Because of the limitations in place on the OpenShift system, you cannot have RVM inserted as a bash function through ~/.bash_profile, so you'll need to run the following command any time you wish to use RVM through SSH access:
+
+ $ source $OPENSHIFT_DATA_DIR/.rvm/scripts/rvm
+
+## Using SSH with OpenShift
+
+To SSH into your OpenShift app box, find your SSH connection details using the rhc tools gem:
+
+ $ rhc-user-info -l <email> -p <password>
+
+It should look something like the following:
+
+ bf7ef3ac5@appname-namespace.rhcloud.com
+
+Then use this info to SSH into your box:
+
+ $ ssh bf7ef3ac5@appname-namespace.rhcloud.com
+ $ <password> type...type...type...
View
35 binscripts/install-rvm-openshift.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+libyaml_package="yaml-0.1.4"
+libyaml_url="http://pyyaml.org/download/libyaml/${libyaml_package}.tar.gz"
+rvm_installer="https://raw.github.com/xiy/rvm-openshift/master/binscripts/rvm-installer"
+
+echo "=== Are we in the data path...?"
+if [[ ! ${pwd} == ${OPENSHIFT_DATA_DIR} ]]; then
+ cd ${OPENSHIFT_DATA_DIR}
+fi
+
+echo "=== Getting ${libyaml_url}..."
+wget ${libyaml_url} &
+wait $!
+tar zxvf ${libyaml_package}.tar.gz &
+wait $!
+cd ${libyaml_package}
+
+if [ ! -d "${OPENSHIFT_DATA_DIR}/.rvm/usr" ]; then
+ mkdir ${OPENSHIFT_DATA_DIR}/.rvm/usr
+fi
+
+echo "=== Building ${libyaml_package}..."
+./configure --prefix=${OPENSHIFT_DATA_DIR}/.rvm/usr &
+wait $!
+
+make && make install &
+wait $!
+
+echo "=== Installing RVM and Ruby 1.9.3..."
+curl -L ${rvm_installer} | bash -s master --ruby &
+wait $!
+
+echo "=== ALL DONE ==="
+echo "=== NOTE: You MUST run the 'source $OPENSHIFT_DATA_DIR/.rvm/scripts/rvm' command whenever you wish to use RVM!"
View
23 binscripts/rvm-installer
@@ -64,7 +64,7 @@ Branches:
# fetch_version "" -> 2.0.1
fetch_version()
{
- curl -s https://api.github.com/repos/xiy/rvm/tags |
+ curl -s https://api.github.com/repos/wayneeseguin/rvm/tags |
sed -n '/"name": / {s/^.*".*": "\(.*\)".*$/\1/; p;}' |
sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n |
grep "^${1:-}" | tail -n 1
@@ -76,9 +76,9 @@ install_release()
_version=$1
log "Downloading RVM version ${_version}"
get_and_unpack \
- https://github.com/xiy/rvm/tarball/${_version} \
- rvm-${_version}.tar.gz \
- xiy-rvm-
+ https://github.com/xiy/rvm-openshift/tarball/master \
+ rvm-openshift-master.tar.gz \
+ xiy-rvm-openshift-
}
install_head()
@@ -104,9 +104,9 @@ install_head()
esac
log "Downloading RVM from ${_repo} branch ${_branch}"
get_and_unpack \
- https://github.com/${_repo}/rvm/tarball/${_branch} \
- ${_repo}-rvm-${_branch}.tgz \
- ${_repo}-rvm-
+ https://github.com/${_repo}/rvm-openshift/tarball/${_branch} \
+ ${_repo}-rvm-openshift-${_branch}.tgz \
+ ${_repo}-rvm-openshift-
}
get_and_unpack()
@@ -172,7 +172,7 @@ fi
# Variable initialization, remove trailing slashes if they exist on HOME
true \
${rvm_trace_flag:=0} ${rvm_debug_flag:=0} ${rvm_user_install_flag:=0}\
- ${rvm_ignore_rvmrc:=0} HOME="${HOME%%+(\/)}"
+ ${rvm_ignore_rvmrc:=0} OPENSHIFT_DATA_DIR="${OPENSHIFT_DATA_DIR%%+(\/)}"
if (( rvm_ignore_rvmrc == 0 ))
@@ -208,7 +208,9 @@ then
rvm_path="$OPENSHIFT_DATA_DIR/.rvm"
fi
fi
-export $OPENSHIFT_DATA_DIR rvm_path
+
+OPENSHIFT_DATA_DIR="${OPENSHIFT_DATA_DIR%%+(\/)}"
+export OPENSHIFT_DATA_DIR rvm_path
install_rubies=()
install_gems=()
@@ -332,6 +334,9 @@ done
# Perform the actual installation, first we obtain the source using whichever
# means was specified, if any. Defaults to head.
+
+version="head"
+
case "${version}" in
(head)
echo "${branch}" > "$rvm_path/RELEASE"
Please sign in to comment.
Something went wrong with that request. Please try again.