jeetdas / utility_commands

This repository has commands I use for making stuff easier for myself.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

utility_commands

This repository has commands I use for making stuff easier for myself.

To make this use full add ~/utility_commands/bin to your PATH.

  • cibot-pull: Copies command to clipboard that is used to make a pull request for CIBot.
  • git_rm_local: Removes all local branches that are safe to remove.
  • push-origin: Alias for git push origin CURRENT_BRANCH.
  • branch-commit: Alias for git commit -m "BRANCH_NAME - MESSAGE", where MESSAGE is passed as a command line string.
  • git-attempt-recovery: This is an alias for an awesome command. It makes it easy to track down "lost" commits in your git repository. Useful if you've deleted something by accident and want to find it again. Alias command: git fsck --unreachable | grep commit | cut -d\ -f3 | xargs git log --merges --no-walk --grep=WIP
  • hipchat-message: This allows you to send a message to hipchat see below for setup and example.

Setup

slack-message

slack-message allows you to send a message to a slack channel. Hard coded to internal c2fo slack for now.

  1. The python requests library. (pip install requests)
  2. An environment variable C2FO_SLACK_CIBOT_TOKEN. You can generate that here
  3. Pass a message to the command: echo "testing the cli" | slack-message

hipchat-message

The hipchat-message command requires the following:

  1. The python requests library. (pip install requests)
  2. An environment variable HIPCHAT_MESSAGE_TOKEN. You can generate that here
  3. Pass a message to the command: echo "testing the cli" | hipchat-message

cibot-pull

The cibot-pull command will work based on the teams in the file. There are two team options. It defauls to using the first team. Also, you can sepcify a branch.

  • cibot-pull -- does the pull against develop with the default team
  • cibot-pull BRANCH -- does the branch with default team
  • cibot-pull BRANCH whole_team does the branch with the devops and team
  • cibot-pull BRANCH devops -- does the branch with devops team

Right now the room is hardcoded to where I want to post my automated messages. If you work at C2FO this may work well for you too.

Command I actually use:

cibot-pull | hipchat-message

Or

cibot-pull | slack-message

About

This repository has commands I use for making stuff easier for myself.

License:The Unlicense


Languages

Language:Python 100.0%