diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 71fa07656..e8597cb49 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -44,6 +44,7 @@ the following format:: user=USERNAME password=PASSWORD url=JENKINS_URL + ignore_cache=IGNORE_CACHE_FLAG **user** This should be the name of a user previously defined in Jenkins. @@ -60,6 +61,10 @@ the following format:: **url** The base URL for your Jenkins installation. +**ignore_cache** + (Optional) If set to True, jenkins job builder + won't be using any cache. + Running ------- diff --git a/etc/jenkins_jobs.ini-sample b/etc/jenkins_jobs.ini-sample index cebc9ef94..538b59b55 100644 --- a/etc/jenkins_jobs.ini-sample +++ b/etc/jenkins_jobs.ini-sample @@ -2,3 +2,4 @@ user=jenkins password=1234567890abcdef1234567890abcdef url=https://jenkins.example.com +ignore_cache=True diff --git a/jenkins_jobs/cmd.py b/jenkins_jobs/cmd.py index 2fdc944c3..c5bf00eac 100755 --- a/jenkins_jobs/cmd.py +++ b/jenkins_jobs/cmd.py @@ -90,17 +90,26 @@ def main(): config.set("jenkins", "url", "http://localhost:8080") config.set("jenkins", "user", None) config.set("jenkins", "password", None) + config.set("jenkins", "ignore_cache", False) logger.debug("Not reading config for test output generation") else: raise jenkins_jobs.errors.JenkinsJobsException( "A valid configuration file is required when not run as a test") logger.debug("Config: {0}".format(config)) + + # check the ignore_cache setting: first from command line, + # if not present check from ini file + ignore_cache = False + if options.ignore_cache: + ignore_cache = options.ignore_cache + elif config.has_option('jenkins', 'ignore_cache'): + ignore_cache = config.get('jenkins', 'ignore_cache') builder = jenkins_jobs.builder.Builder(config.get('jenkins', 'url'), config.get('jenkins', 'user'), config.get('jenkins', 'password'), config, - ignore_cache=options.ignore_cache, + ignore_cache=ignore_cache, flush_cache=options.flush_cache) if options.command == 'delete':