Add artifact base target to nexus configuration 65/4965/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 24 May 2017 00:02:27 +0000 (17:02 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 24 May 2017 00:02:27 +0000 (17:02 -0700)
Projects should be able to push to $groupId.$artifactId.$extension as
well well as anything under that path. Not allowing this means that our
projects always are having to define a broken pom that may look like:

<groupId>org.example.artifactId</groupId>
<artifactId>artifactId</artifactId>

Which means they always end up deploying a base artifact at
$groupId.$artifactId.$artifactId in many cases.

Change-Id: I11a2bcebfe07d39251d85f92ab783c1a2ed5288c
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
lftools/nexus/cmd.py

index c92983b..8940600 100644 (file)
@@ -108,7 +108,8 @@ def create_repos(config_file, settings_file):
     def build_repo(repo, repoId, config, base_groupId):
         print('Building for %s.%s' % (base_groupId, repo))
         groupId = '%s.%s' % (base_groupId, repo)
-        target = '^/%s/.*' % groupId.replace('.', '[/\.]')
+        target1 = '^/%s/.*' % groupId.replace('.', '[/\.]')
+        target2 = '^/%s[\.].*' % groupId.replace('.', '[/\.]')
 
         if 'extra_privs' in config:
             extra_privs = config['extra_privs']
@@ -117,7 +118,7 @@ def create_repos(config_file, settings_file):
 
         create_nexus_perms(
             repoId,
-            [target],
+            [target1, target2],
             settings['email_domain'],
             config['password'],
             extra_privs)