3runoDesign / jumpup

Jumpup is a Ruby on Rails gem that provides a set of tasks to automate all steps of a synchronous continuous integration process, that is, continuous integration without a server such as Travis. Why? Because that's the way we like it!

Home Page:https://rubygems.org/gems/jumpup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jumpup

Build Status RubyGems

Jumpup is a gem that provides a set of tasks to automate all steps of a synchronous continuous integration process for Ruby on Rails apps, that is, continuous integration without a server such as Travis.

Why?

Because that's the way we like it!

Installation

Add the gem to the development section of your Gemfile and run bundle install:

group :development do
  gem 'jumpup'
end

Usage

After installing the gem, you'll need to configure the set of tasks you'll want to run as part of your integration process before using it. The configuration is done by setting an array of Rake task names as the INTEGRATION_TASKS constant on your lib/tasks/jumpup.rake. For example:

INTEGRATION_TASKS = %w(
  jumpup:start
  jumpup:bundle_install
  db:migrate
  spec
  jumpup:git:check_last_commit_change
  jumpup:finish
)

With that in place, you can execute a single task in order to integrate your code safely:

rake integrate

For more information, please have a look at the "Integration Steps" section below.

Plugins

Dependencies

[ProTip] Using Simplecov

Using Simplecov on your test suite will make your tests run slower. You can fix it using an environment variable called coverage on your test / spec helper files to enable Simplecov when needed like:

# On your spec_helper.rb / test_helper.rb
if ENV['coverage'] == 'on'
  require 'simplecov'
  SimpleCov.start 'rails'
end

The coverage variable is set to "on" automatically by the integration process. When running tests while you're developing, Simplecov will not run unless you set the coverage environment variable yourself.

Integration Steps

The integration process is composed of several Rake tasks that are explained below. It's possible to skip one or more steps and add other steps of your own. The complete set of tasks we normally use are:

Rake Task Description
jumpup:integration:check Check if other user is already integrating, to avoid reject message from git after runing all tests.
jumpup:integration:lock Lock the integration to current user.
git:status_check Check if all local files have been commited to the local git repository.
log:clear Remove log files.
tmp:clear Remove temporary files.
git:pull Update local files from the remote git repository.
git:store_last_commit_hash Store last commit hash to be checked before git push.
jumpup:start Run all the previous tasks on this order.
jumpup:bundle_install Run bundle install on quiet mode.
db:migrate Execute any new database migration created by other team members since the last integration.
test or spec Set the rake task your test/spec suite needs to run. Use a command that generate the coverage files.
git:check_last_commit_change Stop integration if a new commit is created since git:store_last_commit_hash.
git:push Push your changes. If any of the previous tasks break, because one test failed, for instance, the script won't push. Actually this task runs only if every checking done before work well.
jumpup:integration:unlock Unlock the integration to current user.
jumpup:finish Run tasks: git:push and jumpup:integration:unlock.

Using this almost paranoid sequence of steps it will be hard to check in bad code in your repository, which is good, very good. The idea is that you should treat your repository as a sacred place, where only good code should ever enter.

More examples

Reckless programmer

Let's say your project don't have tests but you still want to use jumpup. You might get away with this lib/tasks/jumpup.rake:

INTEGRATION_TASKS = %w(
  jumpup:start
  jumpup:bundle_install
  db:migrate
  jumpup:git:check_last_commit_change
  jumpup:finish
)

The fact that you can get away with this doesn't mean you should. Don't you think it's already time to grow up and become more professional about software development? I know you believe you have a great excuse to avoid writing those tests. Still it's just an excuse. Write tests and make a better world!

Test conscious programmer

You haven't jumped on the BDD bandwagon yet. Instead, you write tests, which is good, but they don't cover all of your code yet, which is bad. We believe you will improve it and make sure your tests cover 100% of your code. In the meantime you might need to skip coverage checkings. Try this:

INTEGRATION_TASKS = %w(
  jumpup:start
  jumpup:bundle_install
  db:migrate
  spec
  jumpup:git:check_last_commit_change
  jumpup:finish
)

Spec infected programmer

So you used to TDD all around but then someone told you that this is for gramma. The new wave has a name on it: BDD. So, of course, you now have specs covering 100% of your code and doesn't have any more tests. Great! Just change your test_helper.rb/spec_helper.rb with:

require 'simplecov'
SimpleCov.start 'rails' do
  minimum_coverage 100
end

Tired of debating coding standards?

Do your team agree with this Ruby styleguide? (or at least most of it) Good! Now you can make sure that everyone is following it by installing rubocop on your app and then making sure that you enabled their rake tasks and added it to your integrate tasks list:

INTEGRATION_TASKS = %w(
  jumpup:start
  jumpup:bundle_install
  db:migrate
  spec
  rubocop
  jumpup:git:check_last_commit_change
  jumpup:finish
)

Skip spec

Sometimes we have to change some configuration and deploy as fast as possible. It is possible setting the environment variable SKIP_SPEC=1 to skip specs.

SKIP_SPEC=1 rake integrate

Versioning

Jumpup follows the Semantic Versioning.

Issues

If you have problems, please create a Github Issue.

Contributing

Please see CONTRIBUTING.md for details.

Release

Follow this steps to release a new version of the gem.

  1. Test if everything is running ok;
  2. Change version of the gem on VERSION constant;
  3. Add the release date on the CHANGELOG;
  4. Do a commit "Bump version x.x.x", follow the semantic version;
  5. Run $ rake release, this will send the gem to the rubygems;
  6. Check if the gem is on the rubygems and the tags are correct on the github;

License

This code is free to be used under the terms of the MIT license.

Contact

Comments are welcome.

Maintainers

Authors

Jumpup came from the idea of integration. Thanks to Improve It and the original authors:

Made with love by HE:labs

HE:labs

This gem was created and is maintained by HE:labs.

About

Jumpup is a Ruby on Rails gem that provides a set of tasks to automate all steps of a synchronous continuous integration process, that is, continuous integration without a server such as Travis. Why? Because that's the way we like it!

https://rubygems.org/gems/jumpup

License:MIT License


Languages

Language:Ruby 64.6%Language:Gherkin 35.4%