Skip to content

A Redmine CLI tool write with Swift. πŸ‘¨β€πŸ’»

License

Notifications You must be signed in to change notification settings

marcuswu0814/RedmineBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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. πŸ‘

About

A Redmine CLI tool write with Swift. πŸ‘¨β€πŸ’»

Resources

License

Stars

Watchers

Forks

Packages

No packages published