Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curtisallen/openshift-yeoman
Quickstart repo for Yeoman in openshift
https://github.com/curtisallen/openshift-yeoman
Last synced: 11 days ago
JSON representation
Quickstart repo for Yeoman in openshift
- Host: GitHub
- URL: https://github.com/curtisallen/openshift-yeoman
- Owner: curtisallen
- Created: 2013-01-25T05:40:19.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-25T18:14:34.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T02:54:24.402Z (7 months ago)
- Size: 1.62 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Feel free to change or remove this file, it is informational only.
Repo Layout
===========
node_modules/ - Any Node modules packaged with the app
deplist.txt - Deprecated.
package.json - npm package descriptor.
npm_global_module_list - List of globally installed node modules
(on OpenShift)
.openshift/ - Location for openshift specific files
.openshift/action_hooks/pre_build - Script that gets run every git push before
the build
.openshift/action_hooks/build - Script that gets run every git push as
part of the build process (on the CI
system if available)
.openshift/action_hooks/deploy - Script that gets run every git push after
build but before the app is restarted
.openshift/action_hooks/post_deploy - Script that gets run every git push after
the app is restartedNotes about layout
==================
Please leave the node_modules and .openshift directories but feel free to
create additional directories if needed.Note: Every time you push, everything in your remote repo dir gets recreated
please store long term items (like an sqlite database) in the OpenShift
data directory, which will persist between pushes of your repo.
The OpenShift data directory is accessible relative to the remote repo
directory (../data) or via an environment variable OPENSHIFT_DATA_DIR.Environment Variables
=====================
OpenShift provides several environment variables to reference for ease
of use. The following list are some common variables but far from exhaustive:
process.env.OPENSHIFT_DATA_DIR - For persistent storage (between pushes)
process.env.OPENSHIFT_TMP_DIR - Temp storage (unmodified files deleted after 10 days)When embedding a database using 'rhc app cartridge add', you can reference
environment variables for username, host and password. Example for mysql:
process.env.OPENSHIFT_MYSQL_DB_HOST - DB Host
process.env.OPENSHIFT_MYSQL_DB_PORT - DB Port
process.env.OPENSHIFT_MYSQL_DB_USERNAME - DB Username
process.env.OPENSHIFT_MYSQL_DB_PASSWORD - DB PasswordWhen embedding a NoSQL database using 'rhc app cartridge add', you can
reference environment variables for username, host and password.
Example for MongoDB:
process.env.OPENSHIFT_MONGODB_DB_HOST - NoSQL DB Host
process.env.OPENSHIFT_MONGODB_DB_PORT - NoSQL DB Port
process.env.OPENSHIFT_MONGODB_DB_USERNAME - NoSQL DB Username
process.env.OPENSHIFT_MONGODB_DB_PASSWORD - NoSQL DB PasswordTo get a full list of environment variables, simply add a line in your
.openshift/action_hooks/build script that says "export" and push.deplist.txt
===========
This functionality has been deprecated and will soon go away.
package.json is the preferred method to add dependencies.package.json
============
npm package descriptor - run "npm help json" for more details.Note: Among other things, this file contains a list of dependencies
(node modules) to install alongside your application and is processed
every time you "git push" to your OpenShift application.Development Mode
================When you push your code changes to OpenShift, if you want dynamic reloading
of your javascript files in "development" mode, you can either use the
hot_deploy marker (see .openshift/markers/README) or add the following to
package.json.
"scripts": { "start": "supervisor /server.js" },This will run Node with Supervisor - https://npmjs.org/package/supervisor
Local Development + Testing
===========================You can also develop and test your Node application locally on your machine
(workstation). In order to do this, you will need to perform some
basic setup - install Node + the npm modules that OpenShift has globally
installed:
1. Collect some information about the environment on OpenShift.
A. Get Node.js version information:
$ ssh $uuid@$appdns node -v
B. Get list of globally install npm modules
$ ssh $uuid@$appdns npm list -g2. Ensure that an appropriate version of Node is installed locally.
This depends on your application. Using the same version would be
preferable in most cases but your mileage may vary with newer versions.3. Install the versions of the Node modules you got in step 1.A
Use -g if you want to install them globally, the better alternative
though is to install them in the home directory of the currently
logged user on your local machine/workstation.
pushd ~
npm install [-g] $module_name@$version
popdOnce you have completed the above setup, you can then run your application
locally by using any one of these commands:
node server.js
npm start -d
supervisor server.jsAnd then iterate on developing+testing your application.
Additional information
======================
Link to additional information will be here, when we have it :)