{"id":16945244,"url":"https://github.com/nabiltntn/deploy-meteor-on-openshift","last_synced_at":"2025-04-11T19:33:32.480Z","repository":{"id":71963433,"uuid":"56696693","full_name":"nabiltntn/deploy-meteor-on-openshift","owner":"nabiltntn","description":"Openshift DIY cartidige to deploy Meteor apps instead of .meteor.com ","archived":false,"fork":false,"pushed_at":"2016-08-20T18:28:14.000Z","size":12,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T15:32:23.911Z","etag":null,"topics":["deployment","meteor","openshift"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nabiltntn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-20T15:01:22.000Z","updated_at":"2017-07-22T16:46:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1c43d63-215f-4b50-96c9-c465e264ae2d","html_url":"https://github.com/nabiltntn/deploy-meteor-on-openshift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabiltntn%2Fdeploy-meteor-on-openshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabiltntn%2Fdeploy-meteor-on-openshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabiltntn%2Fdeploy-meteor-on-openshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabiltntn%2Fdeploy-meteor-on-openshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabiltntn","download_url":"https://codeload.github.com/nabiltntn/deploy-meteor-on-openshift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248467280,"owners_count":21108619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","meteor","openshift"],"created_at":"2024-10-13T21:21:43.132Z","updated_at":"2025-04-11T19:33:32.472Z","avatar_url":"https://github.com/nabiltntn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy-meteor-on-openshift\n\nYou know it all, deploying on .meteor.com is no more possible.\nSo if you need to deploy your Meteor application on a free Paas , OpenShift could be a great\nalternative.\n\n\n\n**Note !** : This repository and work is based on the great atricle written by [Tutas-labs](http://www.tutas-labs.com/deploying-meteor-applications-to-openshift-paas/).\n\n\n## Introduction\nOpenShift is a Paas provided by RedHat. The free plan gives you 3 gears with 1G of disk space.\n\nIt does not provide official support for Meteor for the moment by it allows you\nto create your own.\n\n## 1. Create your OpenShift application\nThe first thing to do is to create an application on OpenShift. You need\nto use `Do-It-Yourself 0.1` which is a boileprate you can customize to make it\nsupport Meteor. Openshift creates a Git repository that you will clone on your\nmachine to commit your Meteor app bundle on it.\n\nThen, you need to add the following 'cartidiges' :\n+ MongoDB 2.4\n+ Cron 1.4 : to lunch recurent tasks like checking application state\n+ If your Meteor application uses Spiderable package to make it SEO friendly, you\nneed PhantomJS to be installed with your Openshift application. Openshift does\nnot provide it as cartidige, but it allows you to insall it via a URL,we will use\nthis one : https://raw.githubusercontent.com/daniel-sc/casperjs-cartridge/master/metadata/manifest.yml\n\n## 2. Clone your Openshift Repo on your machine\nYou need to clone the repo on your machine, we will use for this guide\n`app-deploy` as the name for the directory on our machine.\n```sh\ngit clone YOUR_REPO_URL app-deploy\n```\nThe initial content of the repo is the following :\n```sh\nls -al\n\n.git/\n.openshift/\nREADME.md\ndiy/\nmisc/\n```\n\nDelete `.openshift/` , `README.md` , `diy/` and `misc/`\n\n## 3. Clone this repo on your machine\nYou need to clone this repo on your machine to copy its content on `app-deploy`\ndirectory ( except `.git/` directory ), we will use for this guide `app-diy` as\nname.\n\n```sh\ngit clone https://github.com/nabiltntn/deploy-meteor-on-openshift.git app-diy\n```\n\nCopy all the content of `app-diy`  ( except `.git/` folder ) on `app-deploy`\n\nCD to `app-deploy` and install dependencies :\n\n```sh\nnpm install\n```\n\nYour can after that delete `app-diy` if you want.\n\n## 4. Create a bash script on your Meteor app directory and copy/paste this script\n\nWe will give it `push.sh` as name.\n\n\n```bash\n\n#!/bin/sh\n# this assumes you created the openshift directory in your home directory\n# modify the script if this is not the case\n\nif [ $# -eq 0 ]\n  then\n    echo \"Error : you need to precise the path to your application local repo as first argument\"\n    exit 0\nfi\n\nDEPLOY_PROJECT_FOLDER=$1\nTODAY=`date +%d-%m-%Y`\nAPP_NAME=${PWD##*/}\nBUNDLE_NAME=${APP_NAME}.tar.gz\nBUNDLE_EXTRACT_FOLDER=\"bundle\"\n\necho \"-\u003e App local Git repo directory to use : $1 \"\necho '-\u003e Start building the application'\n\nmeteor build ${DEPLOY_PROJECT_FOLDER}\n\ncd ${DEPLOY_PROJECT_FOLDER}\n\necho \"-\u003e Delete the old $BUNDLE_EXTRACT_FOLDER folder to prepare extract\"\nrm -rf ${BUNDLE_EXTRACT_FOLDER}\n\necho \"-\u003e Clean repo from deleted files\"\ngit rm -r ${BUNDLE_EXTRACT_FOLDER}\n\necho '-\u003e Start extracting the application bundle to deploy project folder'\ntar -xvf ${BUNDLE_NAME} ${BUNDLE_EXTRACT_FOLDER}\n\necho '-\u003e Delete the generated bundle'\nrm ${BUNDLE_NAME}\n\necho '-\u003e Generate app_packages_npm_deps file containing the list of app packages NPM dependencies to use in app build'\nnode loadNpmModules.js \u003e app_packages_npm_deps\n\necho '-\u003e Create a file with last deploy date ( also to force deploy even if nothing changed )'\ndate -u \u003e last_build_date\n\necho '-\u003e Commit new version to local repo'\ngit add .\ngit commit -am \"Deploy ${APP_NAME} on ${TODAY}\"\n\necho '-\u003e Push new bundle to app remote Repo on openshift'\ngit push\n\n```\n\nThis script will do the following :\n+ Checks if we pass the path the your local Openshift app repo , for this guide\nthe path to `app-deploy`\n+ Builds your Meteor application\n+ Extracts application bundle to `app-deploy` in `bundle` directory\n+ Generates `app_packages_npm_deps` file that contains all the NPM modules required\nby your Meteor application packages ( if they depend on ) instead of 'guessing'\nthem.\nThis file will be used to install required NPM modules for your Openshift\napplication while bootstraping.\n+ Commits all modifications to your local `app-deploy`\n+ Pushs the app to remote Openshift app to install/update it and restart\n\n**And !!**\n\nTo deploy, CD to your Meteor application and exectue `push.sh` with the path\nto `app-deploy`\n\n```sh\n./push.sh (path to `app-deploy`)\n```\n\n**If you want to deploy a new version of the application, you dont have to repeat\nall the previous steps. Just execute the last command.**\n\n\n\n## Notes\n+ For this guide, i copied a settings.json file `settings-prod.json` under\nprivate directory in my Meteor application. During the build process, this\nfile is copied under `app-deploy/bundle/programs/server/assets/app/settings-prod.json`\nIf your application uses a different name, then you have to indicate it in\n`app-deploy/.openshift/actions_hooks/start` file.\n+ To access application logs, your need to use Openshift `rhc` client and use\nthe `rhc tail APPLICATION_NAME` command. The application generates two files :\n`app_log.log` and `app_err.log`\n+ If your openshift application uses custom domain name, you can change\n`ROOT_URL` env variable in `app-deploy\\meteorshim.js`\n```js\nprocess.env.ROOT_URL = \"http://YOUR_CUSTOM_DOMAIN\" || \"http://localhost\";\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabiltntn%2Fdeploy-meteor-on-openshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabiltntn%2Fdeploy-meteor-on-openshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabiltntn%2Fdeploy-meteor-on-openshift/lists"}