Last active
February 15, 2021 14:04
-
-
Save carsongee/0ed0613eaa2d26eed437 to your computer and use it in GitHub Desktop.
Revisions
-
carsongee revised this gist
Dec 30, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import time JENKINS_BASE = "https://example.com" JENKINS_JOB = "build-software" s = requests.Session() -
carsongee revised this gist
Dec 24, 2014 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import time JENKINS_BASE = "https://jenkins.mitx.mit.edu/job" JENKINS_JOB = "Ops/job/docker-sandbox-lavash" s = requests.Session() @@ -28,9 +28,15 @@ job_number=sys.argv[1], start=start ) ) if response.status_code != 200: print('Job complete or not found') sys.exit(1) if start != response.headers['X-Text-Size']: print(response.text) start = response.headers['X-Text-Size'] try: cont = response.headers['X-More-Data'] except KeyError: -
carsongee revised this gist
Dec 24, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ #!/usr/bin/env python """ Tail a Jenkins build in a terminal """ -
carsongee revised this gist
Dec 24, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,5 +30,8 @@ if start != response.headers['X-Text-Size']: print(response.text) start = response.headers['X-Text-Size'] try: cont = response.headers['X-More-Data'] except KeyError: sys.exit(0) time.sleep(2) -
carsongee created this gist
Dec 24, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ """ Tail a Jenkins build in a terminal """ import os import requests import sys import time JENKINS_BASE = "https://example.com/job" JENKINS_JOB = "build-software" s = requests.Session() s.auth = ( os.environ.get('JENKINS_USERNAME', None), os.environ.get('JENKINS_PASSWORD', None) ) start = 0 cont = True while cont: response = s.get( '{base}/{job}/{job_number}' '/logText/progressiveText?start={start}'.format( base=JENKINS_BASE, job=JENKINS_JOB, job_number=sys.argv[1], start=start ) ) if start != response.headers['X-Text-Size']: print(response.text) start = response.headers['X-Text-Size'] cont = response.headers['X-More-Data'] time.sleep(2)