I try to keep things simple. This is my personal workflow as a single developer. This workflow evolves continually as I grow as a developer and as new tools and practices becomes available. These are my tools: Ruby, Rails, Rspec, Capybara, Git
This is an overview: For production apps I have a development, staging and production environment. As a start to a cycle I only have a master branch. I create a new branch for every feature (named after the feature) and when ready (all tests green) I create the development branch from the feature branch. The development branch pushes to the staging environment. When all tests green on staging I merge with master branch, push to production and delete the feature and development branches.
Here are more detailed steps:
- I write out a story for a feature with sketches.
- I create a new branch(I try to not code in master branch)
git checkout -b newfeaturename
- I write my Rspec tests to test the feature
- I use Spork to pre-load my rails environment (run spork from the console) and a focus tag in the test to only run my new tests.
In rspec test
it "can email advertisers with no listings", focus: true doThen in console run:
rspec spec --drb --tag focusThe --drb option above make use of the spork service allready running
- Implement the code to make tests pass.
- After each test is green or refactored commit to version control
git add .
git commit -am "My commit message"
- When all tests are green and the feature is implemented I create the development branchgit checkout -b development
- Push to staging:(I use Heroku)git push staging development:master
- Do integration tests against staging with saucelabs and a seed database
- If all good, merge with master
git checkout master
git merge development
- Push to git repositry (I use Bitbucket)git push bitbucket master
- Push to production (I use Heroku)git push heroku master
- Rinse and repeat with new features