Commit Graph

14 Commits

Author SHA1 Message Date
Anil Belur 20f561c55d
Add update option to the JJB config sample
Change-Id: Ice7cf29bbf88450951b55cd316be361430eb1d7d
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-25 19:52:20 +05:30
Thanh Ha b093fee501
Add convenience function for plugin namespace
Plugins can use get_plugin_config() which will search in a plugin
namespace. For example:

[plugin "hipchat"]
authtoken = 123token

- Updated hipchat plugin to use get_plugin_config()
- Updated stash plugin to use get_plugin_config()
- Backwards compatibility is kept by falling back to the old
  configuration setting if the new one is not found.
- Warning is displayed if the old configuration method is used.

Change-Id: I7cff063e2d179a5d9a3f221c85de6864382bc477
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2016-11-11 13:34:16 -05:00
Nicolas Glayre 8855eb2523 Stash publisher's credentials configuration
As per now if you want to configure the stash publisher and give it
a username and password, you need to set them in clear text within
the yaml file. This pull request gives the possibility to set these
credentials within the jenkins_jobs.ini file and therefore makes it
possible to not expose them to everyone.

Change-Id: I2e5d6caefb87ded2468c7b7e015e20464ffef99e
2015-08-24 15:23:47 +02:00
Darragh Bailey f68831bd2e Only query jenkins plugins if config provided
Limit querying for plugin information from Jenkins to where an explicit
configuration file has been provided. Where no file is provided, should
avoid any requests that could result in attempting connections.

Add a config options to control this behaviour explicitly so that if a
config file is provided, it may explicitly disable querying jenkins for
additional information from plugins.

The `test` command can use this behaviour to ensure that a basic run is
possible without providing any configuration files, and can be
explicitly configured to disable querying should a config file be used
for testing.

Ensure the default sample configuration skips attempting to query so
that users may use it as a quick test for a working installation without
any network or valid jenkins url dependencies.

Change-Id: I641a3188013debf3765aaff109c4f5fa82a4cedb
2015-04-17 17:16:33 +01:00
Darragh Bailey c5c0eb4f16 Support excludes when recursively processing paths
Include an additional option to exclude some paths/patterns from being
included in the search to allow a complex hierarchy of directories to be
referenced under a single path. Provide support to allow the user to
specify patterns, relative and/or absolute path references.

Implements support for excluding based on absolute path, relative path
and based on simple shell globing patterns.

Change-Id: I236b364c268fd2bf5511a2c6d9a1c87914f3b086
2015-02-17 23:15:56 +00:00
Jenkins 1db5ad59c1 Merge "Error on duplicate job names being found" 2014-10-14 22:03:58 +00:00
Jenkins 45644bf8e5 Merge "Enable hipchat section into sample file" 2014-10-06 18:30:01 +00:00
Darragh Bailey 38c977ceff Error on duplicate job names being found
When parsing yaml files, any duplicate macros, job-templates, job-groups
or jobs should be considered an error by default, but provide a config
option for this to be ignored.

Need to check for seen jobs twice, when processing job groups listed
under projects and again the jobs have been generated from templates.
Use a set and store each job name generated and check on the next
iteration.

Finally walk the list of generated jobs and check if any duplicates are
encountered.

Also ensure that if the user wishes for duplicates to be ignored that
the last defined job replaces the earlier one.

Change-Id: Id31ef33ae1b2469f7c3eeabe77420377978fa35e
2014-09-30 17:55:23 +01:00
Yolanda Robla 0b6b095dc0 Enable hipchat section into sample file
Current sample file lacks section about hipchat. Add section
with dummy token to show hipchat usage.

Added that into default config file for cmd.py, that is the
one used for testing. This will allow to properly test
jobs with hipchat module enabled.

Closes-Bug: #1366063

Change-Id: If511486a69113a4b4300cdb3602154ef261bc18a
2014-09-08 09:50:06 +02:00
David Caro a70126cd94 Added recursive option
Now you can organize your yaml files into subdirectories and apply them
all just passing --recursive option or adding the proper configuration
file option.

In adding support for multiple paths the Builder.load_files method was
reworked to be backward compatible with individual paths or file-like
objects, while also now handling being passed a list of paths or
file-like objects to be parsed.

Change-Id: I126751e347622716c592c6ed1a57b8acb7bf79a4
2014-08-29 18:41:14 +01:00
Darragh Bailey 3e3996d32a Use yaml local tags to support including files
Add support for local tags which are application specific to allow
including of other yaml files or code from scripts. Allows for code to
be maintained and tested as seperate files, as well as reduces
duplication of yaml code that cannot be macro'ed or easily templated by
including it from a common file.

Adds support for the following tags:
  'include' - load file as yaml code
  'include-raw' - load file as data (for scripts)
  'include-raw-escaped' - load file as data with escaping braces '{}'
      as default for use with job-templates

Use configuration file options to provide a search path for the files.

- Test behaviour of yaml tags independent of any XML generation
  by comparing json result of yaml parsing to verify that certain
  tags do/don't recall the yaml.load() method.
- Add examples for the include tags via addition tests for YamlParser
  class

Inspired by
http://stackoverflow.com/questions/528281/how-can-i-include-an-yaml-file-inside-another

Change-Id: Ib90a07043112d4739d6529ceddbc9817668bcec0
2014-06-20 23:16:23 +01:00
David Caro 4206928c1d Added config options to not overwrite jobs desc
When you do not specify any description for a job, right now it creates a
new one overwriting whatever you had put there manually. Now when
setting the configuration option 'keep_descriptions' to True, it will
only overwrite the description if you specified one explicitly in the
yaml.
That way you can avoid specifying any description and it will not
overwrite the ones you put there manually through the jenkins ui.

Added a couple of tests for it also, and extended the tests to allow custom
configuration by adding a *.conf file for it

Change-Id: I408f5ee06a6939a8cb8f4f2e6c6e0d060462259c
Signed-off-by: David Caro <dcaroest@redhat.com>
2014-04-09 23:29:14 +01:00
Yolanda Robla b123c13e99 Enable ignore_cache flag on jenkins_jobs.ini
Parses jenkins_jobs.ini to look for an ignore_cache flag.
If ignore_cache command line option is sent, it takes priority
over the jenkins_jobs.ini configuration.

Change-Id: I88f1ce1aa0d3e0ad25d592d3ca44a022ec9249c3
Closes-Bug: #1193444
2013-12-10 12:59:13 +01:00
Paul Belanger e81b5a5646 Add sample jenkins_jobs.ini configuration file
Change-Id: I8fb296b1b8b17261c46df1eb062ec52d2559307b
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/15035
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-10-30 19:22:36 +00:00