Commit 8f1d0ba1 authored by Corentin Hermet's avatar Corentin Hermet

fix

parent 6ad6ba22
This diff is collapsed.
jenkins_cli_tool
================
.. image:: https://img.shields.io/pypi/v/jenkins_cli_tool.svg
:target: https://pypi.python.org/pypi/jenkins_cli_tool
:alt: Latest PyPI version
.. image:: False.png
:target: False
:alt: Latest Travis CI build status
Jenkins CLI Tool
Usage
......
import click
class Car:
def __init__(self):
self.speed = 0
self.odometer = 0
self.time = 0
def say_state(self):
print("I'm going {} kph!".format(self.speed))
def accelerate(self):
self.speed += 5
def brake(self):
self.speed -= 5
def step(self):
self.odometer += self.speed
self.time += 1
def average_speed(self):
return self.odometer / self.time
if __name__ == '__main__':
my_car = Car()
print("I'm a car!")
while True:
action = raw_input("What should I do? [A]ccelerate, [B]rake, "
"show [O]dometer, or show average [S]peed?").upper()
if action not in "ABOS" or len(action) != 1:
print("I don't know how to do that")
continue
if action == 'A':
my_car.accelerate()
elif action == 'B':
my_car.brake()
elif action == 'O':
print("The car has driven {} kilometers".format(my_car.odometer))
elif action == 'S':
print("The car's average speed was {} kph".format(my_car.average_speed()))
my_car.step()
my_car.say_state()
\ No newline at end of file
import jenkins
import pprint
import click
@click.group()
def cli():
global server
server = jenkins.Jenkins('http://jenkins-qa.lab.dubl.axway.int:8080', username='chermet', password='Shadow1995!!!')
@cli.command()
def sync():
print('Synching')
if __name__ == '__main__':
cli()
\ No newline at end of file
import jenkins
import pprint
if __name__ == '__main__':
server = jenkins.Jenkins('http://jenkins-qa.lab.dubl.axway.int:8080', username='chermet', password='Shadow1995!!!')
print('User: %s' %(server.get_whoami()['fullName']))
jobs = server.get_all_jobs(3)
for job in jobs:
print job['name']
job_status = server.get_job_info("JenkinsCLITest-Corentin")
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(job_status)
print job_status['url']
import click
@click.group()
@click.option('debug/no-debug')
def cli(debug):
click.echo('Debug mode is %s' % ('on' if debug else 'off'))
@cli.command()
def sync():
click.echo('Synching')
@cli.command()
def blah():
click.echo('blah')
if __name__ == '__main__':
cli()
......@@ -3,7 +3,6 @@ import setuptools
setuptools.setup(
name="jenkins_cli_tool",
version="0.1.0",
url="TBD",
author="Corentin Hermet",
author_email="chermet@axway.com",
description="Jenkins CLI Tool",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment