releng/lftools.git
5 years agoAdd "nexus release" command 68/13868/7
Eric Ball [Fri, 7 Dec 2018 01:39:43 +0000 (17:39 -0800)]
Add "nexus release" command

This command will release one or more staging repositories in Nexus.
To ensure proper functionality, this commit also includes fixes for
lftools.nexus.cmd.get_credentials and lftools.cli.nexus.list_images.

Issue: RELENG-916
Change-Id: I5fffea04e160004485e09513834825f4c08b220d
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
5 years agopytest-responses requires pytest<4.1.0 96/14096/2
Eric Ball [Tue, 8 Jan 2019 19:36:52 +0000 (11:36 -0800)]
pytest-responses requires pytest<4.1.0

There is currently a PR open for pytest-responses to make it
compatible with 4.1.0, but until this upgrade is complete, the pytest
version needs to be limited.

Change-Id: I84c4ff8a20891d9a96532d1d773b61d0068cc3c6
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
5 years agoMerge "Make URL example more clear"
Bengt Thuree [Sun, 30 Dec 2018 23:21:16 +0000 (23:21 +0000)]
Merge "Make URL example more clear"

5 years agoOnly print docker image list if not empty 74/13974/4
Eric Ball [Thu, 13 Dec 2018 02:06:48 +0000 (18:06 -0800)]
Only print docker image list if not empty

Issue: RELENG-1595
Change-Id: I516f5e6cedbe1e1bbf25f687e473ca3534c0b683
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
5 years agoMake URL example more clear 51/13951/1
Thanh Ha [Wed, 12 Dec 2018 03:17:57 +0000 (11:17 +0800)]
Make URL example more clear

nexus_repo_url is expecting an exact repo URL and not just the
Nexus server address. Make that more clear.

Change-Id: If6f5f45fb85c719096a4691423c1e48f1c36081c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMerge "Change default ldap server"
Thanh Ha (zxiiro) [Thu, 6 Dec 2018 01:51:08 +0000 (01:51 +0000)]
Merge "Change default ldap server"

5 years agoMerge "Add filenames from zip file to error string"
Thanh Ha (zxiiro) [Thu, 6 Dec 2018 01:30:36 +0000 (01:30 +0000)]
Merge "Add filenames from zip file to error string"

5 years agoChange default ldap server 43/13843/1
Aric Gardner [Wed, 5 Dec 2018 19:09:37 +0000 (14:09 -0500)]
Change default ldap server

Default ldap server for jenkins.int is
ldaps://aws-us-west-2-lfit-openldap-2.linux-foundation.org

Change-Id: I2e1ac34eb8a124cbcc437e4d5e19addd53d5aee5
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
5 years agoAdd filenames from zip file to error string 27/13827/2
Bengt Thuree [Wed, 5 Dec 2018 06:40:12 +0000 (17:40 +1100)]
Add filenames from zip file to error string

When upload a zipfil failes, we embedd the actual file names
to the error string.

Change-Id: Idaa0386522414772cffe7b295d5f27330e70555d
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoFix UnicodeEncodeError when calling deploy logs 25/13825/1 v0.19.1
Thanh Ha [Wed, 5 Dec 2018 03:09:07 +0000 (11:09 +0800)]
Fix UnicodeEncodeError when calling deploy logs

Call .encode('utf-8') after splitting string as f.write() is expecting
an encoded string to write properly.

Issue: RELENG-1515
Change-Id: I88f70af17222fc7931a07e78eba23d9cc60eb9e7
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agofunction correct was replaced with sync-committers 12/13812/1
Aric Gardner [Tue, 4 Dec 2018 20:38:12 +0000 (15:38 -0500)]
function correct was replaced with sync-committers

This change was not reflected in the autocorrectinfofile
fuction

Change-Id: I7251508fce9afe5ebe7f14c941c278c186208258
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
5 years agoFix autocorrectinfofile 40/13740/1 v0.19.0
Aric Gardner [Thu, 29 Nov 2018 18:53:14 +0000 (13:53 -0500)]
Fix autocorrectinfofile

get_committers was renamed as get-committers

Change awk field seperator due to change in the output of
lftools infofile get-committers

Change-Id: Ic7bba44956907635434f97399f36da71a9207a1d
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
5 years agoOnly skip files start with maven-metadata.xml 54/13654/3
Thanh Ha [Mon, 26 Nov 2018 03:05:51 +0000 (11:05 +0800)]
Only skip files start with maven-metadata.xml

Ensure we are only skipping files that start with maven-metadata.xml*
Having the word "maven-metadata" in our artifact is fine as long as it
is not a Maven 2 repo file which is exactly 'maven-metadata.xml' the
trialing * is to ensure it does not pick up the checksum files too.

Also reword the function docs to be more clear about what it does.

Issue: RELENG-1512
Change-Id: Icc20e4581a74625506ac9a0ff5d5e17b45034ccc
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoPrint the time in seconds it took to upload 53/13653/2
Thanh Ha [Mon, 26 Nov 2018 02:58:08 +0000 (10:58 +0800)]
Print the time in seconds it took to upload

Issue: RELENG-1512
Change-Id: I53760367a57ab28f1afc29418cc45db60773e5b9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoReword some of the upload output 52/13652/1
Thanh Ha [Mon, 26 Nov 2018 02:44:59 +0000 (10:44 +0800)]
Reword some of the upload output

Printing file and file upload URL on the same line makes the output a
little too busy and hard to read. We should print the upload URL once
before the upload and after only print the files because we can assume
the path will be the same from that point on.

This makes the output quite a bit easier to parse.

Issue: RELENG-1512
Change-Id: I3b8a0ac07b0cad72706a080a8abf3fd79e2dffed
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoOutput files being uploaded to Nexus 34/13634/1
Thanh Ha [Fri, 23 Nov 2018 04:09:44 +0000 (12:09 +0800)]
Output files being uploaded to Nexus

We need the files to be printed on info so that it is clear which
files were pushed to Nexus for a particular build run.

Issue: RELENG-1512
Change-Id: Id3d273b695bd3bf52e38fa6d5647ae59a48a2144
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoSkip archive copying when pattern is blank 33/13633/1
Thanh Ha [Fri, 23 Nov 2018 01:50:48 +0000 (09:50 +0800)]
Skip archive copying when pattern is blank

Blank patterns are invalid patterns to be copying and causes lftools
to incorrectly copy the entire current working directory. This patch
detects that pattern and skips the pattern as a pattern to archive.

Issue: RELENG-1512
Change-Id: Ia7b0ae4a5b1d6996919bfc2a10deea4c9db84f17
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoSave previous dir and restore it before rmtree 20/13620/2
Thanh Ha [Thu, 22 Nov 2018 05:18:24 +0000 (13:18 +0800)]
Save previous dir and restore it before rmtree

Make sure we restore the previous directory state before calling
rmtree.

Issue: RELENG-1512
Change-Id: Ie5ce6b3f4c19608c90a96c5cac63aa7c5ebd808d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRefactor deploy_nexus_stage to Python 88/13488/6
Bengt Thuree [Tue, 20 Nov 2018 13:02:20 +0000 (00:02 +1100)]
Refactor deploy_nexus_stage to Python

    This is part of the work to convert the existing SHELL
    scripts to Python scripts.

    * deploy nexus stage

Issue: RELENG-1380
Change-Id: I63e5546fb7455253d14effd638e65d45c36487cb
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoMerge "Refactor of Deploy_Nexus"
Thanh Ha (zxiiro) [Thu, 22 Nov 2018 04:42:08 +0000 (04:42 +0000)]
Merge "Refactor of Deploy_Nexus"

5 years agoRefactor of Deploy_Nexus 87/13487/18
Bengt Thuree [Tue, 13 Nov 2018 11:25:56 +0000 (22:25 +1100)]
Refactor of Deploy_Nexus

Refactoring deploy_nexus as part of the lftools-deploy-refactor from
shell to python.

Issue-ID: RELENG-1379
Issue-ID: RELENG-1374
Change-Id: Ibcf732643649600fa7049d92cdf1ac1072590371
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoAdd release note for upload_maven_file_to_nexus. 00/13600/2
Bengt Thuree [Tue, 20 Nov 2018 05:09:27 +0000 (16:09 +1100)]
Add release note for upload_maven_file_to_nexus.

This patch is just to add a release note to earlier provided and merged
patch.

Issue: RELENG-1373
Change-Id: I108b4253175d989c1d27686b5599d1df32b8e39e
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoRefactor upload_maven_file_to_nexus to Python 56/13556/8
Bengt Thuree [Fri, 16 Nov 2018 03:52:30 +0000 (14:52 +1100)]
Refactor upload_maven_file_to_nexus to Python

Issue: RELENG-1373
Change-Id: Ic896b85ee67a5138814b991d433fc27df9d5be54
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoUse new internal _request_post_file function 49/13549/3
Bengt Thuree [Thu, 15 Nov 2018 09:46:41 +0000 (20:46 +1100)]
Use new internal _request_post_file function

Refactor deploy_nexus_zip to use new internal function
_request_post_file

Change-Id: I42c1d7f1fae299680fb20483e0f14e62b85c5885
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoInternal func _request_post_file function 45/13545/7
Bengt Thuree [Thu, 15 Nov 2018 08:13:44 +0000 (19:13 +1100)]
Internal func _request_post_file function

Added one internal function
_request_post_file : requests.post call to upload a file.

Change-Id: Ie5a3ed3fc7c7c2b553d52b66eb8e7dcd9700eb43
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoAdd defusedxml and glob2 to known 3rdparty 77/13477/2
Thanh Ha [Tue, 13 Nov 2018 02:56:45 +0000 (10:56 +0800)]
Add defusedxml and glob2 to known 3rdparty

Change-Id: I2bca0139f1855340863200e82596a4db55fc7685
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRefactor Nexus stage repo close|create cmds 36/13236/26
Bengt Thuree [Fri, 2 Nov 2018 00:51:38 +0000 (11:51 +1100)]
Refactor Nexus stage repo close|create cmds

This is part of the work to convert the existing SHELL
scripts to Python scripts.

Nexus stage repo close
Nexus stage repo create

Issue: RELENG-1371
Change-Id: If93fda483813e2acfc3b283b08cd2de90a467629
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoRefactor Deploy Nexus Zip command to Python 86/13286/7
Bengt Thuree [Thu, 1 Nov 2018 23:20:12 +0000 (19:20 -0400)]
Refactor Deploy Nexus Zip command to Python

Refactor the deploy nexus zip command for better portability with
Windows systems.

Issue: RELENG-1372
Change-Id: I58ea1d7703b626f791dcd74e63251c4f3261ca7d
Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoRefactor deploy-logs cmd to Python 13/13413/7
Thanh Ha [Thu, 8 Nov 2018 02:31:30 +0000 (10:31 +0800)]
Refactor deploy-logs cmd to Python

Issue: RELENG-1377
Change-Id: Ibf58a92fe8800ad77d8be32a123da603c6a36c56
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRefactor deploy-archives to Python 72/13272/10
Thanh Ha [Thu, 1 Nov 2018 15:52:48 +0000 (11:52 -0400)]
Refactor deploy-archives to Python

CLI wise the function was reworked a bit to allow multiple
(-p pattern) calls for better usability.

Issue: RELENG-1376
Change-Id: I232a284c785b413129f8386fc7e799019da1f754
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMerge "Add jenkins and xdg to known 3rdparty"
Thanh Ha (zxiiro) [Fri, 9 Nov 2018 17:24:37 +0000 (17:24 +0000)]
Merge "Add jenkins and xdg to known 3rdparty"

5 years agoInternal func _log_error_and_exit & _request_post 88/13288/11
Bengt Thuree [Fri, 2 Nov 2018 00:51:38 +0000 (11:51 +1100)]
Internal func _log_error_and_exit & _request_post

Adds two internal functions
_log_error_and_exist : prints out 0, 1 or 2 lines of text
                       and then exit with sys.exit(1)

_request_post        : This is a wrapper around request.post
                       Handles three exceptions
                         ConnectionError, MissingSchema, InvalidURL

Change-Id: If8a4d20054d958cbfb3ab651eae037a124420bd3
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoAdd jenkins and xdg to known 3rdparty 73/13373/1
Thanh Ha [Wed, 7 Nov 2018 03:49:45 +0000 (11:49 +0800)]
Add jenkins and xdg to known 3rdparty

Change-Id: Ica655586a045d6aaca226e667e1f3eb1edf1dad3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMerge "Add docker list/delete subcommands for nexus"
Eric Ball [Tue, 6 Nov 2018 21:05:44 +0000 (21:05 +0000)]
Merge "Add docker list/delete subcommands for nexus"

5 years agoMerge changes from topic '13163'
Thanh Ha (zxiiro) [Mon, 5 Nov 2018 03:36:17 +0000 (03:36 +0000)]
Merge changes from topic '13163'

* changes:
  Allow additional credential input methods
  Refactor config sys error handler

5 years agoInternal func _format_url() to verify url fmt 87/13287/3
Bengt Thuree [Thu, 1 Nov 2018 23:48:58 +0000 (19:48 -0400)]
Internal func _format_url() to verify url fmt

Adds a internal function _format_url() to verify url formatting for
domain root.

Change-Id: I0020cf5fb6a848c0fdb2fbc3cd79a48f4c79df4c
Signed-off-by: Bengt Thuree <bthuree@linuxfoundation.org>
5 years agoMerge "Fix copy_archives crash when pattern is None"
Jessica Wagantall [Thu, 1 Nov 2018 22:36:33 +0000 (22:36 +0000)]
Merge "Fix copy_archives crash when pattern is None"

5 years agoFix copy_archives crash when pattern is None 85/13285/1
Thanh Ha [Thu, 1 Nov 2018 21:53:47 +0000 (17:53 -0400)]
Fix copy_archives crash when pattern is None

We should just exist out of the function if no pattern is passed.

Change-Id: I7299b2606713685720ff0cf76b5fddb77296a954
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMerge "Test against explicit major versions of Python"
Thanh Ha (zxiiro) [Thu, 1 Nov 2018 20:50:48 +0000 (20:50 +0000)]
Merge "Test against explicit major versions of Python"

5 years agoFix cli creating /tmp/gpg-sig dir unexpectedly 70/13270/1
Thanh Ha [Thu, 1 Nov 2018 14:42:04 +0000 (10:42 -0400)]
Fix cli creating /tmp/gpg-sig dir unexpectedly

Simply calling the cli always creates 2 directories named
/tmp/gpg-signatures.* and flooding /tmp with unnecessary directories.

This patch resolves these unexpected directory creations by declaring
these tmpdirs in the code rather than the function definition to avoid
this issue.

Change-Id: I3762854fea187082bb8f459ca062e02c1f4eb43f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoTest against explicit major versions of Python 67/13267/1
Thanh Ha [Wed, 31 Oct 2018 22:16:31 +0000 (18:16 -0400)]
Test against explicit major versions of Python

We need to support py27 and py34 for Cent OS but list later
interpreters for local builds.

Bump minimum tox version to 2.0 to ensure we have support for the
skip_missing_interpreters configuration.

Change-Id: If8eb6c988c4fe558ac411e1b1001b265cae9ae99
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRefactor copy_archives deploy function to Python 51/13251/6
Thanh Ha [Wed, 31 Oct 2018 14:38:27 +0000 (10:38 -0400)]
Refactor copy_archives deploy function to Python

Rewrites the copy_archives() bash script to Python for
better portability on Windows systems.

Issue: RELENG-1375
Change-Id: I264c29f9a3b86415fd879ef9dce38714105309f0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoIgnore .pytest_cache directory in Coala 50/13250/1
Thanh Ha [Wed, 31 Oct 2018 12:19:41 +0000 (08:19 -0400)]
Ignore .pytest_cache directory in Coala

Change-Id: I49476c5bf63fc83217cbf8e5957286a2dc9e82f4
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoAllow additional credential input methods 63/13163/3
Thanh Ha [Wed, 24 Oct 2018 01:08:14 +0000 (21:08 -0400)]
Allow additional credential input methods

Provide additional methods for credential passing.

1. Via explicit --password parameter
2. Via environment variable LFTOOLS_PASSWORD
3. At runtime if --interactive mode is set

Issue: RELENG-1207
Change-Id: I9f083cc7b7381ab8df0578664ae29fa18ef279cf
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoRefactor config sys error handler 37/13237/3
Thanh Ha [Mon, 29 Oct 2018 23:42:59 +0000 (19:42 -0400)]
Refactor config sys error handler

Use exception system to allow downstream users to raise their
own exceptions.

Change-Id: I184eadf93f101cbe96ea5a1e10406dac6c906767
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoAdd docker list/delete subcommands for nexus 81/12581/19
Eric Ball [Thu, 13 Sep 2018 00:36:16 +0000 (17:36 -0700)]
Add docker list/delete subcommands for nexus

This commit adds a "docker" subcommand to "nexus", with options to
list or delete images. This is intended for docker repos in Nexus 3.

Also includes logic in the Nexus class to find the version and
correct API base path from the provided URL.

Issue-ID: RELENG-1164
Change-Id: I759297ed9f49566df6062b2a158e0954673e29eb
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
5 years agoLock pre-commit to version 1.11.2 62/13162/1
Eric Ball [Wed, 24 Oct 2018 01:02:18 +0000 (18:02 -0700)]
Lock pre-commit to version 1.11.2

The latest version, 1.12.0, is causing problems with the
lftools-tox-verify Jenkins job.

Change-Id: Ifa7cb9d90bb6691a3892778e3b186256bc4e4501
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
5 years agoAdd --conf parameter to jenkins sub-cmd 45/13045/2
Thanh Ha [Thu, 18 Oct 2018 00:09:58 +0000 (20:09 -0400)]
Add --conf parameter to jenkins sub-cmd

Per request from Ieb54acc2d12de9bb21620112380f20be14fe9113 this
patch adds a --conf parameter to the jenkins subcommand to allow
overriding the JJB_INI default locations.

Issue: RELENG-1206
Change-Id: Ia1af96ccb64451199a1dc3994ae8b3004272afdb
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoMerge "Fix get-credentials subcommand" v0.18.0
Jeremy Phelps [Fri, 19 Oct 2018 15:05:21 +0000 (15:05 +0000)]
Merge "Fix get-credentials subcommand"

5 years agoUpdate reno to 2.11.2 67/13067/2
Thanh Ha [Thu, 18 Oct 2018 18:19:19 +0000 (14:19 -0400)]
Update reno to 2.11.2

Issue: RELENG-1355
Change-Id: I2a194aa557a7a29ed4e70f084dd4255266ee29ab
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoFix get-credentials subcommand 62/13062/1
Thanh Ha [Thu, 18 Oct 2018 17:39:59 +0000 (13:39 -0400)]
Fix get-credentials subcommand

When we refactored the Jenkins module in
I2168adf9bc992b719da6c0350a446830015e6df6 we forgot to refactor
the get-credentials command so it broke.

Change-Id: I1ee04d2753327557e4d7e5e017a3d6ca7741fef0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoAdd cmd to clean up stale openstack heat stacks 74/12674/5
Thanh Ha [Thu, 20 Sep 2018 01:57:41 +0000 (21:57 -0400)]
Add cmd to clean up stale openstack heat stacks

Issue: RELENG-237
Change-Id: I8e2fcef93798395cc61f686a143ca3add5d081f2
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoFix typo in reorder-staged-repos help cmd 19/13019/1
Thanh Ha [Tue, 16 Oct 2018 23:28:03 +0000 (19:28 -0400)]
Fix typo in reorder-staged-repos help cmd

Strangely the docs builder is only catching this now.

Change-Id: I73b40d600183a8075f085a504c974a21e9daa31e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoRefactor the Jenkins object into a class 75/12675/4
Thanh Ha [Thu, 20 Sep 2018 02:24:42 +0000 (22:24 -0400)]
Refactor the Jenkins object into a class

Make it easier for us to reuse the Jenkins instance in commands
outside of the jenkins command group.

Issue: RELENG-237
Change-Id: I2168adf9bc992b719da6c0350a446830015e6df6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd token init cmd to add new server cfg 11/12511/11
Thanh Ha [Sat, 8 Sep 2018 19:52:01 +0000 (15:52 -0400)]
Add token init cmd to add new server cfg

New token init command to automatically fetch API token and add new
server configuration section into jenkins_jobs.ini. This file should
already exist. This cmd uses the globally configured user credentials
in lftools.ini to initialize the new Jenkins server configuration.

Change-Id: I3d4bb0fd5696fd1bbeb26eb7d609bab5e064ba92
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd cmd to reset API tokens in jenkins_jobs.ini 10/12510/11
Thanh Ha [Sat, 8 Sep 2018 19:31:35 +0000 (15:31 -0400)]
Add cmd to reset API tokens in jenkins_jobs.ini

Convenience command to automatically reset API tokens in
jenkins-jobs.ini.

Change-Id: I6d84760368b6a12e9e9622b5ce9496a278321dc4
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd jenkins token cmd to retrieve the API token 08/12508/8
Thanh Ha [Sat, 8 Sep 2018 17:53:14 +0000 (13:53 -0400)]
Add jenkins token cmd to retrieve the API token

Change-Id: I43397d25978aaf752db33003044e7cb8d4884705
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Move JJB_INI to static variable"
Andrew Grimberg [Wed, 12 Sep 2018 18:48:53 +0000 (18:48 +0000)]
Merge "Move JJB_INI to static variable"

6 years agoMerge changes from topic 'share-cloud-images'
Andrew Grimberg [Wed, 12 Sep 2018 18:34:21 +0000 (18:34 +0000)]
Merge changes from topic 'share-cloud-images'

* changes:
  Add cmd to upload openstack images
  Add cmd to share openstack images

6 years agoMerge "Enable universal wheel"
Andrew Grimberg [Wed, 12 Sep 2018 18:31:10 +0000 (18:31 +0000)]
Merge "Enable universal wheel"

6 years agoMove JJB_INI to static variable 09/12509/7
Thanh Ha [Sat, 8 Sep 2018 18:56:00 +0000 (14:56 -0400)]
Move JJB_INI to static variable

We don't expect this location to change so set a static variable
that we can reuse more easily across modules.

Change-Id: Ieb54acc2d12de9bb21620112380f20be14fe9113
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoUse logger instead of print in Jenkins CLI 07/12507/3
Thanh Ha [Sat, 8 Sep 2018 18:27:34 +0000 (14:27 -0400)]
Use logger instead of print in Jenkins CLI

Change-Id: I6e99c69f75a0be5c0e54da5c21a2930652ad3f8e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoDisable fast fail on parallel sigul 23/12523/1 v0.17.1
Andrew Grimberg [Mon, 10 Sep 2018 19:29:04 +0000 (12:29 -0700)]
Disable fast fail on parallel sigul

Sigul bridges seem to possibly have an issue with a lot of in parallel
signing requests. This is either an issue with the bridge, the server,
or a disconnected across the network VPN backhaul between the server and
bridge. Instead of having the signing just outright fail on the first
problem, we should try a few times.

Change-Id: I98a5c8adeb25e892899a221dc2078a9fc779f74e
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
6 years agoEnable universal wheel 05/12505/1
Thanh Ha [Fri, 7 Sep 2018 23:24:30 +0000 (19:24 -0400)]
Enable universal wheel

lftools is Python 2 and 3 compatible so enable universal wheels.

Change-Id: I7a75f944030e35d4b021709700084abf11b6ae00
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd cmd to upload openstack images 98/12498/4
Thanh Ha [Fri, 7 Sep 2018 17:42:09 +0000 (13:42 -0400)]
Add cmd to upload openstack images

Issue: RELENG-1201
Change-Id: I1f6072fbfff003a4602d3765a6a5ce7c94fe4c58
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd cmd to share openstack images 83/12483/5
Thanh Ha [Fri, 7 Sep 2018 03:06:18 +0000 (23:06 -0400)]
Add cmd to share openstack images

Allows us to more easily share images to multiple openstack tenants.

Issue: RELENG-1201
Change-Id: I58dc200f7b29429ee1215bacdc533d234ad153fb
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Use reno 2.10.0 and remove reno.yaml"
Jessica Wagantall [Fri, 7 Sep 2018 18:41:59 +0000 (18:41 +0000)]
Merge "Use reno 2.10.0 and remove reno.yaml"

6 years agoRemove prelude 97/12497/1
Thanh Ha [Fri, 7 Sep 2018 17:24:38 +0000 (13:24 -0400)]
Remove prelude

This prelude did not make much sense for the patch the introduced it.

Change-Id: I8ccd3ba8ff02a43db043cfca842645dd1dccd89c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoUse reno 2.10.0 and remove reno.yaml 96/12496/1
Thanh Ha [Fri, 7 Sep 2018 17:12:26 +0000 (13:12 -0400)]
Use reno 2.10.0 and remove reno.yaml

Reno 2.10.0 supports our regex pattern so we no longer need to
configure it.

Also add reno to tox so that people can run it via:

    tox -e reno new slug

Change-Id: Ic5f4de1af139e0cf99e955a30e3d957772563f57
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd npm metadata to .gitignore 93/12393/2 v0.17.0
Thanh Ha [Sat, 25 Aug 2018 05:41:57 +0000 (01:41 -0400)]
Add npm metadata to .gitignore

Change-Id: Ifa5ebace74db851e00fb2431ef06f38952ec3e24
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Add stack create & delete commands"
Sam Hague [Thu, 6 Sep 2018 14:54:57 +0000 (14:54 +0000)]
Merge "Add stack create & delete commands"

6 years agoMerge "Deduplicate test requirements"
Sam Hague [Thu, 6 Sep 2018 14:54:48 +0000 (14:54 +0000)]
Merge "Deduplicate test requirements"

6 years agoUse logger instead of print in version module 98/12398/3
Thanh Ha [Mon, 27 Aug 2018 01:25:24 +0000 (21:25 -0400)]
Use logger instead of print in version module

Change-Id: I31329886088d8d7a469e19bc0937912546400109
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoUpdate config subsystem to use logger 97/12397/4
Thanh Ha [Mon, 27 Aug 2018 00:58:29 +0000 (20:58 -0400)]
Update config subsystem to use logger

Use our logger service in the config subsystem.

Change-Id: I47235cf9accd362ba1355ff77e15757543d30da1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoOnly print extra log details in DEBUG mode 90/12390/8
Thanh Ha [Sat, 25 Aug 2018 01:04:13 +0000 (21:04 -0400)]
Only print extra log details in DEBUG mode

This allow us to change all our print statements to log.info() and
have it still print sanely like a CLI application. Then when DEBUG
mode is enabled it will print the extra details to let us
troubleshoot. ERROR and CRITICAL logs will prefix with "ERROR: "
for example.

Change-Id: Ic35222ee654306e686052c209b641f9e49d38144
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Add support to jenkins cmd for jenkins_jobs.ini"
Thanh Ha (zxiiro) [Mon, 27 Aug 2018 22:23:43 +0000 (22:23 +0000)]
Merge "Add support to jenkins cmd for jenkins_jobs.ini"

6 years agoMerge "Add ruamel.yaml and yaml as known 3rdparty"
Thanh Ha (zxiiro) [Mon, 27 Aug 2018 22:23:34 +0000 (22:23 +0000)]
Merge "Add ruamel.yaml and yaml as known 3rdparty"

6 years agoMerge "Enable or disable Jenkins jobs matching regex"
Thanh Ha (zxiiro) [Mon, 27 Aug 2018 17:03:09 +0000 (17:03 +0000)]
Merge "Enable or disable Jenkins jobs matching regex"

6 years agoEnable or disable Jenkins jobs matching regex 82/12382/8
Anil Belur [Fri, 24 Aug 2018 04:22:11 +0000 (09:52 +0530)]
Enable or disable Jenkins jobs matching regex

ex:
To enable jobs

To disable jobs

JIRA: RELENG-1117
Change-Id: Iff800472cecfe056285f07e1c2461775457cb0ab
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
6 years agoDeduplicate test requirements 00/12400/1
Thanh Ha [Mon, 27 Aug 2018 02:43:02 +0000 (22:43 -0400)]
Deduplicate test requirements

Some of these tests being pulled in are duplicates. Let's consolidate
into requirements-test.txt as the source of truth.

Change-Id: I2481a364b9ddf2aa0ba9e2168d4ee408ca477c43
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd support to jenkins cmd for jenkins_jobs.ini 91/12391/2
Thanh Ha [Sat, 25 Aug 2018 05:23:08 +0000 (01:23 -0400)]
Add support to jenkins cmd for jenkins_jobs.ini

Allow the jenkins command to use existing jenkins_jobs.ini for
configuration. By default assume jenkins_jobs.ini's default
configuration 'jenkins'.

This change makes 'server', 'user', and 'password' parameters no
longer required as defaults replace the need for these options.

'server' now defaults to 'jenkins' if jenkins_jobs.ini exists,
otherwise defaults to 'http://localhost:8080' which is the default
Jenkins deploy port.

'user' now defaults to 'admin' which is the Jenkins default admin
user.

'password' has no default and must be set by the user as this
is randomly generated by Jenkins at boot.

Change-Id: Ic7af1eb53e8e9079b845203f44914310616c4bab
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd ruamel.yaml and yaml as known 3rdparty 92/12392/1
Thanh Ha [Sat, 25 Aug 2018 05:38:40 +0000 (01:38 -0400)]
Add ruamel.yaml and yaml as known 3rdparty

Change-Id: I954835b3e1a1700119d2e2328444b7794e7365fc
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMake ldap module optional 84/12384/3 v0.16.1
Thanh Ha [Fri, 24 Aug 2018 15:38:27 +0000 (11:38 -0400)]
Make ldap module optional

Install via 'pip install lftools[ldap]'.

Change-Id: Ie2206b43b094e1576936ba934268dc0b68fc5a40
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoRemove summary/version which comes from PBR now 83/12383/2 v0.16.0
Thanh Ha [Fri, 24 Aug 2018 14:38:04 +0000 (10:38 -0400)]
Remove summary/version which comes from PBR now

Change-Id: I19b0358a85beb281a07df1ef8ea84c8c7593927f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Extend lftools with scripts for ldap lookups"
Thanh Ha (zxiiro) [Fri, 24 Aug 2018 14:26:48 +0000 (14:26 +0000)]
Merge "Extend lftools with scripts for ldap lookups"

6 years agoAdd option to enable debug logs 79/12379/4
Thanh Ha [Fri, 24 Aug 2018 01:36:46 +0000 (21:36 -0400)]
Add option to enable debug logs

Default the logger to INFO level and add an option to turn on DEBUG
level logs. Update the unit_tests to pass in a context since we need
it now in order to support the top-level configuration.

Change-Id: I253a127f7dc0cee5475d8403da8f82e018fdf36e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoSimplify logging configuration 78/12378/3
Thanh Ha [Fri, 24 Aug 2018 01:23:18 +0000 (21:23 -0400)]
Simplify logging configuration

lftools should be a simple tool and folks should not ever need to
configure the logger so let's simplify things and just pre-define
an acceptable logger configuration. The important component is
having (DEBUG) messages print via logger service. A subsequent
patch will be provided to enable --debug level logs via CLI.

Change-Id: I74158d94400112161ad4fc206426420d908deb0c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd extras declaration in docs-linkcheck 81/12381/1
Thanh Ha [Fri, 24 Aug 2018 02:05:54 +0000 (22:05 -0400)]
Add extras declaration in docs-linkcheck

This should have been added to
I1f33c65a44cf6eaa0e29e5734f3a8edcd8865868

Also include missing reno notes.

Change-Id: I132bebe298164419fae43e94299f43c45940bc4e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoFix broken help from openstack and sign cmds 80/12380/1
Thanh Ha [Fri, 24 Aug 2018 02:05:54 +0000 (22:05 -0400)]
Fix broken help from openstack and sign cmds

These were never caught since we did not enable fail on warnings
for Sphinx until recently.

Change-Id: I1f33c65a44cf6eaa0e29e5734f3a8edcd8865868
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoAdd stack create & delete commands 53/12353/4
Thanh Ha [Tue, 21 Aug 2018 23:05:31 +0000 (19:05 -0400)]
Add stack create & delete commands

Add 2 new commands:

    - stack create
    - stack delete

These commands allow lftools the ability to create and delete stacks.

Issue: RELENG-235
Change-Id: Ied7ff51a292199675dc944e36f1d821a5a2d045d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoExtend lftools with scripts for ldap lookups 58/11558/46
Aric Gardner [Tue, 26 Jun 2018 19:16:08 +0000 (15:16 -0400)]
Extend lftools with scripts for ldap lookups

Add 2 new commands to lftools:

    - infofile
    - ldap

prereqs:
For ldap lookups to work you must be on the VPN and have the cert
to get the cert: log in to any collab system and grab /etc/ipa/ca.crt
in /etc/openldap/ldap.conf

TLS_REQCERT always
TLS_CACERTDIR /etc/openldap/certs
TLS_CACERT /etc/openldap/certs/ca.crt

To test:

1. Clone this patchset
2. start venv

   pip uninstall lftools && pip install -e .

Usage:

$ lftools ldap
Usage: lftools ldap [OPTIONS] COMMAND [ARGS]...

  LDAP TOOLS.

Commands:
  autocorrectinfofile  Verify INFO.yaml against LDAP group.
  csv                  Query an Ldap server.
  inactivecommitters   Check committer participation.
  yaml4info            Build yaml of commiters for your INFO.yaml.

$ lftools infofile
Usage: lftools infofile [OPTIONS] COMMAND [ARGS]...

  INFO.yaml TOOLS.

Commands:
  get-committers    Extract Committer info from INFO.yaml or LDAP...
  sync-committers   Script to insert missing values from ldap...

Issue: RELENG-407
Change-Id: I4f4055441042d790008754bb085447f52e1c1a78
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
6 years agoUse reno for release notes 30/12330/2
Thanh Ha [Mon, 20 Aug 2018 16:55:54 +0000 (12:55 -0400)]
Use reno for release notes

Change-Id: Iadb0ca93a6f1f6a56c948b42bd257040547fffcc
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoSetup PBR for lftools 07/12307/3
Thanh Ha [Fri, 17 Aug 2018 18:46:33 +0000 (14:46 -0400)]
Setup PBR for lftools

Change-Id: I028540301560b76af1cb31f2d9c40612b3b3480f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoRemove unnecessary echo 17/12017/2
Thanh Ha [Fri, 27 Jul 2018 15:07:44 +0000 (11:07 -0400)]
Remove unnecessary echo

Since Sphinx 1.7.x, Sphinx itself now prints the output location
at the end of a build so there's no need to do this unnecessary echo
anymore.

Change-Id: I517dea4686b68140be4ab672d6e909e446919163
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoBump to 0.16.0-dev 31/12031/1
Thanh Ha [Mon, 30 Jul 2018 15:33:03 +0000 (11:33 -0400)]
Bump to 0.16.0-dev

Change-Id: Ia255aefd6e1a05d2fb8440584406b6d8fbe5f2f3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoRelease lftools v0.15.0 19/12019/3 v0.15.0
Thanh Ha [Fri, 27 Jul 2018 15:47:18 +0000 (11:47 -0400)]
Release lftools v0.15.0

Change-Id: I3a3196f64cefabb390315a85e277d4652c9b30cb
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoMerge "Handle snapshot artifacts in get_file_info()"
Thanh Ha [Mon, 30 Jul 2018 15:16:07 +0000 (15:16 +0000)]
Merge "Handle snapshot artifacts in get_file_info()"

6 years agoHandle snapshot artifacts in get_file_info() 29/12029/2
Anil Belur [Mon, 30 Jul 2018 02:29:22 +0000 (12:29 +1000)]
Handle snapshot artifacts in get_file_info()

This fixes lftools deploy maven-file to upload snapshot
artifacts to Nexus.

Issue: RELENG-1098
Change-Id: I5ed1c030b2b9c8f62e7f7e4ee0a63858782a747c
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
6 years agoAdd utility to check repos for commits missing DCO 27/11927/25
Jeremy Phelps [Mon, 23 Jul 2018 19:04:30 +0000 (14:04 -0500)]
Add utility to check repos for commits missing DCO

This only works on git repositories.

Change-Id: I45a0a66dfaaf517cdc5d85fc15f60e403bccfeb9
Co-Authored-By: Eric Ball <eball@linuxfoundation.org>
Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
6 years agoAdd optional classifier def to deploy cmd 38/11938/1
Thanh Ha [Mon, 23 Jul 2018 22:45:09 +0000 (18:45 -0400)]
Add optional classifier def to deploy cmd

The artifact/maven/content API supports an optional classifier
parameter so add option for it.

Change-Id: Ibf89ac2fb15e7fe289cb76aafad41936b24f3a9f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>