Last active
August 29, 2015 14:05
-
-
Save connyay/79a5ba420e9cac541504 to your computer and use it in GitHub Desktop.
Building node app with grunt on open shift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOME=$OPENSHIFT_REPO_DIR | |
cd $OPENSHIFT_REPO_DIR | |
if ! which nvm >/dev/null; then | |
curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash | |
fi | |
source ~/.nvm/nvm.sh | |
nvm install v0.10 | |
mv _package.json package.json | |
mkdir -p "$OPENSHIFT_DATA_DIR"node_modules | |
ln -s "$OPENSHIFT_DATA_DIR"node_modules node_modules | |
npm install --production | |
./node_modules/bower/bin/bower install | |
./node_modules/grunt-cli/bin/grunt build | |
ls -1 | grep -E -v 'dist|node_modules|.tmp' | xargs rm -rf | |
mv dist/* . | |
rm -rf dist | |
export NODE_ENV="production" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $OPENSHIFT_REPO_DIR | |
mv package.json _package.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment