项目作者: burgesQ

项目描述 :
Create an gitlab issue, push to a branch associated to this issue and create an MR from one cli call
高级语言: Shell
项目地址: git://github.com/burgesQ/fix_that_dirty_bug.git
创建时间: 2019-10-22T12:23:53Z
项目社区:https://github.com/burgesQ/fix_that_dirty_bug

开源协议:

下载


fix_that_dirty_bug

required

You’ll need :

  • a token (file or cli)
  • a git base url (file or cli)

The files must be located in

  1. $ pwd
  2. /home/$USER/.config/ftdb/

token

Generate a token from gitlab with the API scope (doc)

Pass the token via the cli param -t 'token' of create a file with the token inside :

  1. $ cat .config/ftdb/.git_token
  2. SECRET_TOKEN

base url

The base url should be the http dns of your git server. Pass the value via the cli param -u 'http://git.mycomany.org' or via a file :

  1. $ cat .config/ftdb/.base_url
  2. http://git.mycomany.org

usag

  1. 14:47:46 fix_that_dirty_bug -h
  2. usage:
  3. fix_that_dirty_bug -n 'issue name' -b 'branch name' -p 'project name' -a 'assignee' [ -d 'issue description' ] [ -t 'git token' | -T '/token/path' ] [ -u 'base url' | -B '/base/url/path' ] [ -U|-P ] [ -l (0..3)]
  4. Required params :
  5. -n : issue name
  6. -b : branch name (format: master-[issue id]-[cli val])
  7. -p : project name
  8. -a : user assigned to the issue and MR
  9. Optional params :
  10. -d : issue description
  11. -t : git token
  12. -T : git token file path
  13. Default : [/home/master/.config/ftdb/.git_token]
  14. -u : base url to query the git API
  15. -B : base url file path
  16. Default : [/home/master/.config/ftdb/.base_url]
  17. -U : force re-create and display the user list
  18. -P : force re-create and display the project list
  19. -l : log level (0=error,1=info,2=warn,3=debug).
  20. Default : [2]
  21. Create an issue, then push the work to a automatic branch, create an MR from the branch which reference the newly created issue.
  22. Return value :
  23. -2 : no git url provided
  24. -1 : no git token provided
  25. 0 :
  26. 1 : wrong cli param
  27. 2 : not in a git repository
  28. 3 : missing curl binary
  29. 4 : error while creating the issue
  30. 5 : error while creating the merge request
  31. 6 : can't fetch the project list
  32. 7 : can't fetch the users list
  33. 8 : can't fetch project ID
  34. 9 : can't fetch git user ID
  35. 10 : can't fetch the created issue ID

Explain what it is

Explain how it work

Explain how to use it

Link gitlab token gen

Quick use