Giter Site home page Giter Site logo

sachinbhutani / meteor-openshift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramr/nodejs-custom-version-openshift

27.0 8.0 8.0 44 KB

Meteor 1.2 cartridge to run meteor applications on OpenShift

License: MIT License

Shell 50.06% HTML 22.23% JavaScript 27.71%

meteor-openshift's Introduction

Run Meteor 1.2 on Red Hat's OpenShift PaaS

This git repository is a sample Meteor base cartidge with can be used with your Meteor application to run it on openshift.com PaaS platform

The catridge would install NodeJS version 0.10.40

Step 0

  1. Create on Openshift account at http://openshift.com/
  2. Install rhc tools to manage your openshift account : https://developers.openshift.com/en/managing-client-tools.html

Step 1 - Get NodeJS v0.10.40 running on your openshift app

Create a new application mynodeapp in your openshift login control panel using the standard NodeJS 0.10 cartrige. You may choose to add auto-scaling while setting this up. Choosing autoscaling would add an HAProxy instance you your application.

Now clone the git URL available on your application page to your local system

git clone SOURCE_CODE_URL  mylocalnodeapp

Add this github meteor-openshift repository to mylocalnodeapp

cd mylocalnodeapp
git remote add upstream -m master git://github.com/sachinbhutani/meteor-openshift.git
git pull -s recursive -X theirs upstream master

Check if the execution flag is set for scripts located inside the given folders:

.openshift\action_hooks 
.openshift\lib

Then commit and push the repo to OpenShift

git add --all
git commit -a -m 'nodejs'
git push

You should now have a NodeJs version 0.10.40 application running at:

http://mynodeapp-mydomain.rhcloud.com
( See env @ http://mynodeapp-mydomain.rhcloud.com/env )

Check the URL http://mynodeapp-mydomain.rhcloud.com/env and save the environment variables to a local file. You may need some of them if something goes wrong.

Step 2 Setup Mongo DB 3.0

On your application page go to the link "See the list of cartridges you can add", paste the URL below in "Install your own cartridge" textbox at the bottom of the page and click "Next".

    http://cartreflect-claytondev.rhcloud.com/github/icflorescu/openshift-cartridge-mongodb

Alternatively if you like to use another MongoDB database hosts like http://compose.io or http://mongolab.com/ You would need to update the meteorshim.js file as described in the next section with a MONGO_URL if you plan to use an external MongoDB host.

Step 3 Update env variables

Update the file meteorshim.js to use your own MONGO_URL env variable. MAIL_URL and other env variables may also be added as needed.

Step 4 Adding your Meteor App

Build your meteor app and un-bundle it into the mylocalnodeapp directory for pushing to OpenShift

The following steps need to be repeated each time you want to push an updated version of your meteor app to openshift. You may create a shell script for it in your meteor repo

Assuming your awesome meteor app repo is in dir mymeteorapp

cd mymeteorapp
meteor build tarball
cp tarball/mymeteorapp.tar.gz ~/path/to/mylocalnodeapp
rm tarball/mymeteorapp.tar.gz
cd ~/path/to/mylocalnodeapp

# for Mac or BSD-based
tar -xvf mymeteorapp.tar.gz -s '/^bundle//'

# for Linux, or using GNU tar
tar -xvf mymeteorapp.tar.gz --transform 's|^bundle/||'

rm mymeteorapp.tar.gz
git add --all
git commit -a -m 'meteor-openshift'
git push

After a lot of messages from the remote server, your awesome Meteor app should be finally running at http://mynodeapp-mydomain.rhcloud.com


This repo has not been throughly tested, please report any issues or suggest improvements.

meteor-openshift's People

Contributors

araczkowski avatar ekuiter avatar kanakiyajay avatar paku- avatar ramr avatar ryanheung avatar sachinbhutani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-openshift's Issues

How to test remote Meteor?

I just built and deployed Meteor as suggested. From the logs below, it looks successful.

remote: Initiating MeteorShim
remote: Starting NodeJS cartridge
remote: *********** Meteor Environment ************
remote: MONGO_URL IS: mongodb://127.10.247.2:27017/
remote: ROOT_URL IS: http://mynodeapp-easyjobs.rhcloud.com
remote: PORT: 8080
remote: BIND_IP: 127.10.247.1
remote: DDP_URL: http://mynodeapp-easyjobs.rhcloud.com:8000
remote: ************ Starting NodeJS 0.10.40 SERVER  ************
remote: Thu Sep 08 2016 09:43:15 GMT-0400 (EDT): Node server started on 127.10.247.1:8080 ...
remote: Application is already running
remote:
remote:   - Using Node.js version 0.10.40, checking app URI ...
remote:   - test URI = http://mynodeapp-easyjobs.rhcloud.com/env
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success

When I try the following, I get a timeout or 404.

http://mynodeapp-easyjobs.rhcloud.com:3000/ (timeout)
http://mynodeapp-easyjobs.rhcloud.com:8080/ (timeout)
http://mynodeapp-easyjobs.rhcloud.com:8000/ (404)

When I run everything locally and the Ionic2 app accesses Meteor with the default http://localhost:3000, it works. So I changed the Ionic2 app to point to the remote server.

The Ionic2 App I have is trying to access it on http://mynodeapp-easyjobs.rhcloud.com:3000/8080/8000 unsuccessfully.

Question

How do I check if Meteor is running? What should I make my Ionic2 (Angular2) app point to?

Thanks

Issue setting up node

I am getting a "fatal: read error: Invalid argument" for the following code.

git pull -s recursive -X theirs upstream master

I am using git on win7 is there anything that needs to be changed?

TIA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.