Repository: yetus Updated Branches: refs/heads/master cdb41916c -> fd124b8a6
YETUS-605. jenkins-admin lacks version information Signed-off-by: Allen Wittenauer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/fd124b8a Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/fd124b8a Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/fd124b8a Branch: refs/heads/master Commit: fd124b8a6b9935ce7413c6779b00dd10f4ddc594 Parents: cdb4191 Author: Akira Ajisaka <[email protected]> Authored: Sun Feb 18 22:42:22 2018 +0900 Committer: Akira Ajisaka <[email protected]> Committed: Thu Feb 22 11:02:18 2018 +0900 ---------------------------------------------------------------------- precommit/jenkins/jenkins-admin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/fd124b8a/precommit/jenkins/jenkins-admin.py ---------------------------------------------------------------------- diff --git a/precommit/jenkins/jenkins-admin.py b/precommit/jenkins/jenkins-admin.py index 62f6e7a..af46556 100755 --- a/precommit/jenkins/jenkins-admin.py +++ b/precommit/jenkins/jenkins-admin.py @@ -130,7 +130,24 @@ if __name__ == '__main__': help='Submit Job to jenkins') parser.add_option('--max-history', dest='history', type='int', help='Maximum history to store', default=5000) + parser.add_option( + '-V', + '--version', + dest='release_version', + action='store_true', + default=False, + help="display version information for jenkins-admin and exit.") + (options, args) = parser.parse_args() + + # Handle the version string right away and exit + if options.release_version: + with open( + os.path.join( + os.path.dirname(__file__), "../../VERSION"), 'r') as ver_file: + print ver_file.read() + sys.exit(0) + tokenFrag = '' if options.jenkinsToken: tokenFrag = 'token=%s' % options.jenkinsToken
