Last active
August 29, 2015 14:01
-
-
Save MichaelJCole/323df245392a963207f1 to your computer and use it in GitHub Desktop.
MEAN.JS setup summary
This file contains hidden or 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
#!/bin/bash | |
## Setup your MEAN.JS and Heroku dev/stage/prod environment | |
# http://blog.powma.com/fast-cheap-and-mean-devstageprod-server-setup-with-heroku/ | |
# Config for your project: | |
YOURAPPNAME=YOUR_APP_NAME | |
## Create Production server | |
# From our repo directory, create a heroku app | |
heroku create $YOURAPPNAME | |
# Make this production server | |
git remote rename heroku production | |
# Add MongoHQ db | |
heroku addons:add mongohq --app $YOURAPPNAME | |
# Configure for Production | |
heroku config:set NODE_ENV=production --app $YOURAPPNAME | |
# Deploy | |
git push production master | |
heroku open --app $YOURAPPNAME | |
## Create Staging server | |
# Configure | |
heroku fork -a $YOURAPPNAME $YOURAPPNAME-stage | |
git remote add stage [email protected]:$YOURAPPNAME-stage.git | |
heroku config:set NODE_ENV=production --app $YOURAPPNAME-stage | |
# Deploy | |
git push stage dev:master | |
heroku open --app $YOURAPPNAME-stage |
This file contains hidden or 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
#!/bin/bash | |
## Setup your MEAN.JS project | |
# http://blog.powma.com/git-you-some-mean-js-setup-advanced-git/ | |
# Config for your project: | |
GITHUB=GITHUB_ACCOUNT | |
BITBUCKET=BITBUCKET_ACCOUNT | |
PROJECT=BITBUCKET_PROJECT | |
# Fork project on GitHub | |
# Clone it | |
git clone [email protected]:$GITHUB/mean.git $PROJECT | |
cd $PROJECT | |
# Make your dev branch | |
git checkout -b dev | |
# Make a remote called upstream to the Official repo | |
git remote add upstream https://github.com/meanjs/mean.git | |
# fetch upstream repo data. | |
git fetch upstream | |
# Branch for MEAN.JS code - track upstream master for changes | |
git checkout -b meanjs --track upstream/master | |
# Configure remote for pull requests | |
git remote rename origin fork | |
# Setup a private repo. Don't forget your ssh key | |
# Configure new origin to private repo | |
git remote add origin [email protected]:$BITBUCKET/$PROJECT.git | |
# Push local branches to origin. Set upstream so they push/pull to origin automatically | |
git push --set-upstream origin master | |
git push --set-upstream origin dev | |
# leave meanjs upstream as remote upstream | |
git push origin meanjs | |
# Ok, end of configuration | |
exit 0 | |
## Task: Update project from Official MEAN.JS | |
git pull upstream master | |
# Or because we used --track to configure branch | |
git checkout meanjs | |
git pull | |
# Switch to our dev branch and merge changes | |
git checkout dev | |
git merge meanjs | |
## TASK: Contribute code back to MEAN.JS | |
# Syntax: [remote] [branch] | |
git push fork meanjs | |
# Goto GitHub.com and make your pull request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment