Reup
reup helps you context switch between projects by getting your various development environments up to date quickly.
Use it like so:
$ cd ~/code/my-awesome-project
$ reupThis will do two things:
-
git pullso you have the lastest code - Start your application server
- reup knows what codebase you're using, so it can guess pretty well what it needs to do to start your server.
- For example, if reup detects a
Gemfilewith Foreman, it will runbundle exec foreman start. If it detectsember-cli-build.js, it will runember serve. This is totally configurable.
reup also supports conditional actions:
- If, in your Ember app, reup detects that
package.jsonorbower.jsonwere modified bygit pull, it will also runnpm install. Again, this is completely configurable.
--resetdb
- also
-r - Reset the database after pulling. Useful if you have someone on your team with a proclivity to rewrite migrations.
--branch
-
also
-b -
Perform a
git checkoutof the given branch prior to pulling. -
For example, this will take you back to the master branch:
# reup -b master
First, run reup --init. This will create a file ~/.reup.yaml where you can place your custom commands.
The default .reup.yaml looks like this:
---
ember:
indicator_files:
- ember-cli-build.js
serve:
command: "ember server"
install:
command: "npm install"
only_if_changed:
- bower.json
- package.json
- ember-cli-build.js
rails:
indicator_files:
- Gemfile
serve:
command: "bundle exec foreman start"
install:
command: bundle
only_if_changed:
- Gemfile
db:
reset_command: "bundle exec rake db:migrate:reset"
migrate_command: "bundle exec rake db:migrate"A few notes about this file:
- Top-level values indicate project types. You can have as many as these as you want, and name them whatever you want.
- Each project type is determined by a series of
indicator_filesthat must be present in the working directory.
- These need to be unique to a specific project. You can't have two projects that only specify
Gemfileas an indicator file, for instance.
- The action to be taken upon detecting the indicator files is specified in
serve. -
installis where you specify how dependencies are installed for this project type.
- If you like, you can also write an
only_if_changedproperty here. The install command will only be run if any of the files you specify are changed by the pull.
- Some projects, like Rails, also support
dbactions.
- These allow you to quickly reset your database or run migrations after doing a pull.