Skip to content

cesarferreira/robin

Repository files navigation

Robin

Run scripts on any project

Build Status npm npm

Every project has a different way of deploying/releasing/cleaning/etc. By maintaining a simple json file with all the available tasks everyone can use/edit/add on a project level.

All of the above was generated based on this robin.json file at the root of a flutter project:

{
    "scripts": {
      "clean": "flutter clean && rm-rf ./src/gen/",
      "release": "fastlane ios app_distribution release --{{env}} --rollout=1'",
      "release testflight": "fastlane ios release -e={{env}}'"
    }
}

Will result in the following list:

❯ robin list
==> clean                 # flutter clean && rm-rf ./src/gen/                               
==> release               # fastlane ios app_distribution release --{{env}} --rollout=1'    
==> release testflight    # fastlane ios release -e={{env}}'             

No need to re-generate / compile any code, it will read your robin.json every time you run a command.

Install

npm install -g robin-cli-tool

Usage

robin init

Creates a template robin.json in your current folder.

{
    "scripts": {
      "clean": "...",
      "deploy staging": "echo 'ruby deploy tool --staging'",
      "deploy production": "...",
      "release beta": "...",
      "release alpha": "...",
      "release dev": "..."
    }
  }
  

Example:

robin release beta      # Would run your script to release your app to beta
robin deploy staging    # Would deploy your server to staging environment
robin list              # Lists all the available commands

Passing params

By using the following scheme: {{variable}} => --variable=XXX

This config:

{
    "scripts": {
      "clean": "flutter clean && rm-rf ./output/",
      "release": "ruby deploy_tool --{{env}}'",
      "release testflight": "fastlane ios release -e={{env}}'",
    }
}

Makes this possible:

# clean your builds
robin clean

# deploy the app to the store
robin release --env=staging
robin release --env=production
robin release --env=dev

# release an alpha build
robin release testflight --env=alpha

IDEAS (not implemented yet)

Giving the robin.json:

{
    "scripts": {
      "deploy staging": "echo 'ruby deploy tool --staging'",
      "deploy production": "echo 'ruby deploy tool --production'",
      "release beta": "...",
      "release alpha": "..."
    }
}
  

Writing:

robin deploy 

Will suggest:

  • robin deploy staging
  • robin deploy production

Unless there's a robin deploy in your scripts list

Interactive mode

robin --interactive 

So we can fuzzy search the available tasks

Have init templates

robin init --android
robin init --ios
robin init --flutter
robin init --rails

Add

robin add # Adds a command

Example:

robin add "deploy" "fastlane deliver --submit-to-review" # Adds a deploy command to your current list of commands

Created by

Cesar Ferreira

License

MIT © Cesar Ferreira