Skip to content

Instantly share code, notes, and snippets.

@phund
phund / deploy.rb
Created August 30, 2016 07:58 — forked from fightingtheboss/deploy.rb
Capistrano deploy script for deploying multiple app instances of a Meteor app to a single private VPS on different ports.
# This deploy script takes a parameter to define the number of instances to deploy (default is 1)
# ex: cap deploy -s instances=3
set :application, "YOUR_APP_NAME"
set :repository, "git@YOUR_GIT_REPOT.git"
set :scm, :git
set :deploy_via, :remote_cache
set :user, "deploy"
set :deploy_to, "/home/deploy/www/#{application}"
@phund
phund / README
Created August 30, 2016 07:58 — forked from harrylove/README
Capistrano deploy script for Meteor on AWS running RedHat
This assumes you've already set up your instance with node, npm, forever, mongodb, configured ports, and have optionally added a web server like nginx to proxy access to meteor.
Local
1. Install Ruby
2. gem install capistrano
3. cd /your/meteor/project
4. capify .
5. edit config/deploy.rb as needed with below
AWS
@phund
phund / deploy.rb
Created August 30, 2016 07:57 — forked from thefron/deploy.rb
Node.js deploy /w Capistrano 3
# config/deploy.rb
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'my_app'
set :repo_url, '[email protected]:USER/my_app.git'
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/var/node/my_app'
@phund
phund / meteor_forever_capistrano_monit.markdown
Last active October 25, 2016 06:39
Deploy meteor with forever, capistrano and monit on a EC2

How to deploy meteor app with forever capistrano 3.6.1 and monit (current test with meteor 1.4.1 and ubuntu server 14.04 - EC2)

Step 1: Install enviroment on server

  1. Install node, mongodb... (Please see https://gist.github.com/phund/7372628980516376dfe5eaf8a559428d for more detail)
  2. Install monit

Step 2: Setup capistrano in local

  1. Install ruby
@phund
phund / Deploy meteor app with nginx and passenger.markdown
Last active March 30, 2017 11:34
Deploy meteor app with nginx and passenger

How to deploy meteor app with nginx and passenger (current test with meteor 1.4.1 and ubuntu server 14.04)

Step 1: Setup server enviroment

Install nginx and passenger

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates

--- Add our APT repository

@phund
phund / build-release.sh
Created June 15, 2016 09:59 — forked from rknell/build-release.sh
Build Android Release apk from Cordova /CLI
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.
@phund
phund / gist:51d00ce5a2b3ae2d90b082099fff0afc
Last active August 30, 2016 07:41
Build a cordova plugin
https://taco.visualstudio.com/en-us/docs/createplugintutorial/
1. Install plugman
npm install -g plugman
2.
  1. Add cordova plugin meteor add cordova:[email protected]
  2. Add config on mobile-config.js App.configurePlugin('cordova-plugin-customurlscheme', { URL_SCHEME: '<name_of_scheme (ex: openapp => openapp://link/to/path)>' });
  3. Add handle open url function on js window.handleOpenURL = function handleOpenURL(receiveUrl) { setTimeout(function() { let url = receiveUrl;
@phund
phund / gist:1233fa7d9cbc2811eb4117e15a2182b4
Last active August 30, 2016 07:41
meteor cordova google plus
-Override corrdova build. Fix crash app
```
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
```
Note: Add override after meteor reset or catch error
```
.meteor/local/cordova-build/platforms/android" is not an Android project.
```
<project-dir>/cordova-build-overrride/flatforms/android/build-extra.grade
@phund
phund / gist:955c84476681a16047b40e1ed526b4e3
Created May 24, 2016 06:31
mrt_accounts-facebook-cordova.js
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////