~tomasgroth/openlp/portable-path

« back to all changes in this revision

Viewing changes to scripts/jenkins_script.py

  • Committer: Tomas Groth
  • Date: 2019-04-30 19:02:42 UTC
  • mfrom: (2829.2.32 openlp)
  • Revision ID: tomasgroth@yahoo.dk-20190430190242-6zwjk8724tyux70m
trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
###############################################################################
6
6
# OpenLP - Open Source Lyrics Projection                                      #
7
7
# --------------------------------------------------------------------------- #
8
 
# Copyright (c) 2008-2018 OpenLP Developers                                   #
 
8
# Copyright (c) 2008-2019 OpenLP Developers                                   #
9
9
# --------------------------------------------------------------------------- #
10
10
# This program is free software; you can redistribute it and/or modify it     #
11
11
# under the terms of the GNU General Public License as published by the Free  #
44
44
import re
45
45
import time
46
46
from argparse import ArgumentParser
47
 
from subprocess import Popen, PIPE
 
47
from subprocess import PIPE, Popen
48
48
 
49
49
from jenkins import Jenkins
50
50
 
 
51
 
51
52
JENKINS_URL = 'https://ci.openlp.io/'
52
53
REPO_REGEX = r'(.*/+)(~.*)'
53
54
 
61
62
    Branch_macOS_Tests = 'Branch-02b-macOS-Tests'
62
63
    Branch_Build_Source = 'Branch-03a-Build-Source'
63
64
    Branch_Build_macOS = 'Branch-03b-Build-macOS'
64
 
    Branch_Code_Analysis = 'Branch-04a-Code-Analysis'
 
65
    Branch_Code_Analysis = 'Branch-04a-Code-Lint'
65
66
    Branch_Test_Coverage = 'Branch-04b-Test-Coverage'
66
67
    Branch_Lint_Check = 'Branch-04c-Lint-Check'
67
68
    Branch_AppVeyor_Tests = 'Branch-05-AppVeyor-Tests'
83
84
class JenkinsTrigger(object):
84
85
    """
85
86
    A class to trigger builds on Jenkins and print the results.
86
 
 
87
 
    :param token: The token we need to trigger the build. If you do not have this token, ask in IRC.
88
87
    """
89
88
 
90
89
    def __init__(self, username, password, can_use_colour):
101
100
        Get the job info for all the jobs
102
101
        """
103
102
        for job_name in OpenLPJobs.Jobs:
104
 
            job_info = self.server.get_job_info(job_name)
105
 
            self.jobs[job_name] = job_info
106
 
            self.jobs[job_name]['nextBuildUrl'] = '{url}{nextBuildNumber}/'.format(**job_info)
 
103
            try:
 
104
                job_info = self.server.get_job_info(job_name)
 
105
                self.jobs[job_name] = job_info
 
106
                self.jobs[job_name]['nextBuildUrl'] = '{url}{nextBuildNumber}/'.format(**job_info)
 
107
            except Exception:
 
108
                pass
107
109
 
108
110
    def trigger_build(self):
109
111
        """