Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contrib/bash-completion/jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _jenkins()
builds \
start \
info \
configxml \
setbranch \
stop \
console \
Expand All @@ -28,7 +29,7 @@ _jenkins()
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
queue|building|builds|start|info|setbranch|stop|console|changes)
queue|building|builds|start|info|configxml|setbranch|stop|console|changes)
opts="-h --help"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
Expand Down
5 changes: 5 additions & 0 deletions jenkins_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ def info(self, args):
scm_name,
branch_name))

def configxml(self, args):
job_name = self._check_job(args.job_name)
job_config = self.jenkins.get_job_config(job_name)
print(job_config)

def setbranch(self, args):
job_name = self._check_job(args.job_name)
xml = self.jenkins.get_job_config(job_name)
Expand Down
3 changes: 3 additions & 0 deletions jenkins_cli/cli_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def load_parser():
start_parser = subparsers.add_parser('info', help='Job info')
start_parser.add_argument('job_name', help='Job to get info for')

start_parser = subparsers.add_parser('configxml', help='Job config in xml format')
start_parser.add_argument('job_name', help='Job to get config for')

set_branch = subparsers.add_parser('setbranch', help='Set VCS branch (Mercurial or Git)')
set_branch.add_argument('job_name', help='Job to set branch for')
set_branch.add_argument('branch_name', help='Name of the VCS branch')
Expand Down