Swiftpack.co - Package - marcuswu0814/RedmineBot

RedmineBot

Build Status codebeat badge codecov

RedmineBot is a CLI tool help to post commit log to Redmine.

TODO

  • Support linux.
  • Better unit test.
  • User custom template.
  • Support much more Redmine REST API with CLI.

Any other suggestion? Feel free to create an issue or PR. 🙏

Installation

macOS

Homebrew

$ brew install marcuswu0814/homebrew-taps/redminebot

# try it
$ redmine-bot version

Done. 🎉

Ubuntu

Manually

Step 1

Install all swift dependency.

$ sudo apt-get install clang libicu-dev git build-essential libcurl4-openssl-dev

Step 2

Install swiftenv, see install detail on document

For example, use zsh

$ git clone https://github.com/kylef/swiftenv.git ~/.swiftenv

$ echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.zshenv
$ echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(swiftenv init -)"' >> ~/.zshenv

Then restart shell.

Step 3

Use swiftenv to install swift version 4.0.3

$ swiftenv install 4.0.3

Step 4

Clone RedmineBot source code and build it with swift

$ git clone https://github.com/marcuswu0814/RedmineBot.git
$ cd RedmineBot/
$ make build-for-linux

# The bin name must be `redmine-bot`, don't rename it.
$ sudo mv .build/release/RedmineBot /usr/bin/redmine-bot

# try it
$ redmine-bot version

Done. 🎉 Then you can remove source code.

Note: Some linux build issue tracking on #10.

Setup

$ redmine-bot setup REDMINE_SERVER_URL API_ACCESS_KEY

Get API_ACCESS_KEY from My account page right hand side.

$ cd PATH_TO_YOUR_REPO
$ redmine-bot install-hook

Redmine-bot will install post-commit and post-rewrite hook in specific repo. after execute install-hook command.

Usage

Example

Commit

$ cd PATH_TO_YOUR_REPO
$ touch testFile
$ git add --all
$ git commit -m "Commit for #123 and #255"

Every time you commited, post-commit hook will run. And post commit message to Redmine issue number #123 and #255.

Rebase

$ cd PATH_TO_YOUR_REPO
$ git pull --rebase

If pull repo. from git server and not fast forward, commit will re-write, and post-rewrite hook run.

Just like post-commit, RedmineBot will post a new note to let you know commit sha is updated.

Uninstall

$ redmine-bot uninstall-hook

Redmine-bot will delete post-commit and post-rewrite hook after executing uninstall-hook command.

Contact

If you find an issue or have questions, feel free to let me know. 👍

Github

link
Stars: 4
Help us keep the lights on

Used By

Total: 0

Releases

0.2.0 - Sep 7, 2018

Feature

  • Implement uninstall-hook feature. #14

Enhancement

  • Remove unnecessary parentheses. #17

Thanks @f40507777 and @tonyyang924. 🙌

0.1.0 - Apr 11, 2018

Feature

  • Add Version command for version check. #5
  • Implement install-hook feature. post-commit and post-rewrite hook will be executed and post commit message to Redmine. #6

CI enhancement

  • Add Travis CI build. #1
  • Add Travis CI and Codebeat label. #3
  • Add tests for commands and support Codecov. #4

0.0.1 - Mar 31, 2018