Skip to content

Federico Tutorial

Rafael Chacon edited this page Feb 22, 2012 · 1 revision

Mongo

Dumping DB (just as in common tasks)

Restoring:

mongorestore --host localhost:27017 --db piictu_development --drop dump/app357079/

Other

u = User.create(username:'foo', email:'foo@test.com', password: 'mypass', password_confirmation: 'mypass', fullname: 'foobar', admin: true)

rvm exec bundle exec rake -T

Redis

To clean redis if it got stopped at a bad moment, log into redis-cli and type flushall

Heroku

To deploy heroku

rvm exec bundle exec rake api_dev deploy

rvm exec bundle exec rake api_staging deploy

rvm exec bundle exec rake api_dev heroku:config:list

rvm exec heroku config --long --app piictu-api-dev # Displays environment variables

rvm exec bundle exec rake api_dev heroku:config # To configure environment variables

Run development system:

Configuring Heroku new instance

Add to config/heroku-env.environemtn.yml

Add to config/heroku-env.yml

Add to config/heroku.yml

rvm exec bundle exec thor deploy:api_dev:config # To add environment variables

start mongodb local:

$ mongod --dbpath .

$ rvm exec script/rails s 2>/dev/null

$ rvm ruby script/rails c 2>/dev/null #Console

Git Hub tutorial:

$ git branch -a #Branches we hava

$ git pull origin develop #Update develop

$ git branch -D #Erase branch

$ git flow feature start name_of_branch #Start a new git flow

$ git st #Status

$ git flow feature finish name_of_branch #Close feature git flow

$ git add # add un commited files

$ git commit -m "message"

$ git push origin :feature/lock_popular Erases the remote branch lock_popular

$ git push origin feature/searcher publishing a branch

Forcing a push

git push api-dev develop:master --force

Testing and debugging

$ rake rspec

$ tail -f log/test.log # For watching Mongo

Full commit

git st make sure all changes are commited

git add filename

git commit -m "message"

git flow feature finish

git pull origin develop

git push origin develop

Merge with develop from a feature

git stash save mail_not save work

git checkout develop

git pull origin develop

git checkout feature/my_branch

git merge develop

git stash pop

Checkout remote branch git clone git@github.com:piictu/webapp.git

Clone this wiki locally