Repository: cekit/cekit

Issue:
error: Unknown subcommand: get-url when performing an OSBS build
**Describe the bug**
Cekit 3.0.0 dies with a python backtrace when attempting an OSBS build (see logs below)

**To reproduce**
[this image source](github.com/jmtd/openjdk), branch CLOUD-2868-RHEL8-JDK11 with [this cct_modules cloned into the checkout](github.com/jmtd/cct_module), branch rhel82k19 commit 50a68f527010e2f4ff43d81437f166491e350d93 and this local change made

```
diff --git a/image.yaml b/image.yaml
index 9d3884d..00b827b 100644
--- a/image.yaml
+++ b/image.yaml
@@ -28,10 +28,7 @@ packages:
 
 modules:
   repositories:
-  - name: cct_module
-    git:
-      url: https://github.com/jboss-openshift/cct_module.git
-      ref: master
+  - path: cct_module
   install:
   - name: jboss.container.openjdk.jdk
     version: "8"
```

**Expected behavior**
successfully submit an OSBS build

**Logs**
```
(3.0.0)  cekit --redhat -v build --overrides-file ubi8-jdk11-overrides.yaml osbs
2019-04-23 16:03:41,514 cekit        DEBUG    Running version 3.0.0
2019-04-23 16:03:41,515 cekit        DEBUG    Configuring CEKit...
2019-04-23 16:03:41,516 cekit        DEBUG    Removing dirty directory: 'target/image/modules'
2019-04-23 16:03:41,527 cekit        DEBUG    Removing dirty directory: 'target/repo'
2019-04-23 16:03:41,668 cekit        INFO     You are running on known platform: Red Hat Enterprise Linux Server 7.6 (Maipo)
2019-04-23 16:03:41,669 cekit        DEBUG    Checking CEKit core dependencies...
2019-04-23 16:03:41,669 cekit        DEBUG    Checking if 'git' dependency is provided...
2019-04-23 16:03:41,669 cekit        DEBUG    CEKit dependency 'git' provided via the '/usr/bin/git' executable.
2019-04-23 16:03:41,669 cekit        DEBUG    All dependencies provided!
2019-04-23 16:03:41,688 cekit        INFO     Generating files for OSBS engine
2019-04-23 16:03:41,689 cekit        DEBUG    Loading override 'ubi8-jdk11-overrides.yaml'
2019-04-23 16:03:41,689 cekit        DEBUG    Reading descriptor from 'ubi8-jdk11-overrides.yaml' file...
2019-04-23 16:03:41,713 cekit        INFO     Initializing image descriptor...
2019-04-23 16:03:41,715 cekit        DEBUG    Checking CEKit generate dependencies...
2019-04-23 16:03:41,715 cekit        DEBUG    Reading descriptor from 'image.yaml' file...
2019-04-23 16:03:41,788 cekit        DEBUG    Downloading module repository: 'cct_module'
2019-04-23 16:03:41,788 cekit        INFO     Preparing resource 'cct_module'
…
2019-04-23 16:03:43,830 cekit        WARNING  The image has ContentSets repositories specified, all other repositories are removed!
2019-04-23 16:03:43,856 cekit        INFO     Handling artifacts...
2019-04-23 16:03:43,856 cekit        INFO     Preparing artifact hawkular-javaagent
2019-04-23 16:03:43,856 cekit        DEBUG    Getting brew details for an artifact with 'f97f623e5b614a7b6d1eb5ff7158027b' md5 sum
2019-04-23 16:03:43,856 cekit        DEBUG    Executing '/usr/bin/brew call --json-output listArchives checksum=f97f623e5b614a7b6d1eb5ff7158027b type=maven'.
2019-04-23 16:04:08,868 cekit        DEBUG    Executing 'brew call --json-output getBuild buildInfo=617215'
2019-04-23 16:04:11,053 cekit        DEBUG    Artifact added to fetch-artifacts-url.yaml
2019-04-23 16:04:11,053 cekit        INFO     Preparing artifact jolokia-jvm-1.5.0.redhat-1-agent.jar
2019-04-23 16:04:11,054 cekit        INFO     Preparing resource 'jolokia-jvm-1.5.0.redhat-1-agent.jar'
2019-04-23 16:04:11,054 cekit        DEBUG    Checking 'target/image/jolokia-jvm-1.5.0.redhat-1-agent.jar' md5 hash...
2019-04-23 16:04:11,054 cekit        DEBUG    Computing md5 checksum for 'target/image/jolokia-jvm-1.5.0.redhat-1-agent.jar' file
2019-04-23 16:04:11,056 cekit        DEBUG    Hash is correct.
2019-04-23 16:04:11,056 cekit        DEBUG    Local resource 'jolokia-jvm-1.5.0.redhat-1-agent.jar' exists and is valid
2019-04-23 16:04:11,056 cekit        INFO     Preparing artifact jmx_prometheus_javaagent
2019-04-23 16:04:11,056 cekit        DEBUG    Getting brew details for an artifact with '620d5c068e4ca408ad99c244f8706fce' md5 sum
2019-04-23 16:04:11,056 cekit        DEBUG    Executing '/usr/bin/brew call --json-output listArchives checksum=620d5c068e4ca408ad99c244f8706fce type=maven'.
2019-04-23 16:04:18,932 cekit        DEBUG    Executing 'brew call --json-output getBuild buildInfo=781344'
2019-04-23 16:04:21,135 cekit        DEBUG    Artifact added to fetch-artifacts-url.yaml
2019-04-23 16:04:21,149 cekit        DEBUG    Artifacts handled
2019-04-23 16:04:21,149 cekit        INFO     Rendering Dockerfile...
2019-04-23 16:04:21,267 cekit        DEBUG    Dockerfile rendered
2019-04-23 16:04:21,267 cekit        DEBUG    Checking CEKit build dependencies...
2019-04-23 16:04:21,268 cekit        DEBUG    Checking if 'rhpkg' dependency is provided...
2019-04-23 16:04:21,268 cekit        DEBUG    CEKit dependency 'rhpkg' provided via the '/usr/bin/rhpkg' executable.
2019-04-23 16:04:21,268 cekit        DEBUG    Checking if 'brewkoji' dependency is provided...
2019-04-23 16:04:21,268 cekit        DEBUG    All dependencies provided!
2019-04-23 16:04:21,291 cekit        INFO     Pulling latest changes in repo containers/openjdk...
2019-04-23 16:04:24,288 cekit        DEBUG    Changes pulled
2019-04-23 16:04:24,293 cekit        INFO     Removing old 'repos' directory
2019-04-23 16:04:24,294 cekit        INFO     Removing old 'modules' directory
fatal: pathspec 'repos' did not match any files
2019-04-23 16:04:24,418 cekit        INFO     Updating lookaside cache...
2019-04-23 16:04:24,421 cekit        DEBUG    Executing '['/usr/bin/rhpkg', 'new-sources', 'jolokia-jvm-1.5.0.redhat-1-agent.jar']'
2019-04-23 16:04:25,289 cekit        INFO     Update finished.
2019-04-23 16:04:25,297 cekit        INFO     No changes made to the code, committing skipped
error: Unknown subcommand: get-url
usage: git remote [-v | --verbose]
   or: git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
   or: git remote rename <old> <new>
   or: git remote remove <name>
   or: git remote set-head <name> (-a | -d | <branch>)
   or: git remote [-v | --verbose] show [-n] <name>
   or: git remote prune [-n | --dry-run] <name>
   or: git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
   or: git remote set-branches [--add] <name> <branch>...
   or: git remote set-url [--push] <name> <newurl> [<oldurl>]
   or: git remote set-url --add <name> <newurl>
   or: git remote set-url --delete <name> <url>

    -v, --verbose         be verbose; must be placed before a subcommand

Traceback (most recent call last):
  File "/home/ce/cekit/3.0.0/bin/cekit", line 11, in <module>
    load_entry_point('cekit==3.0.0', 'console_scripts', 'cekit')()
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/cli.py", line 171, in build_osbs
    run_build(ctx, 'osbs')
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/cli.py", line 282, in run_build
    run_command(ctx, builder_impl)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/cli.py", line 251, in run_command
    Cekit(common_params).run(clazz, params)
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/cli.py", line 341, in run
    command.execute()
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/builder.py", line 60, in execute
    self.run()
  File "/home/ce/cekit/3.0.0/lib/python2.7/site-packages/cekit/builders/osbs.py", line 260, in run
    ["git", "remote", "get-url", "origin"]).strip().decode("utf8")
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', 'remote', 'get-url', 'origin']' returned non-zero exit status 129

```

**Environment information:**
 - Operating system Red Hat Enterprise Linux Server release 7.6 (Maipo)

 - CEKit version: 3.0.0

Discussion:

Patch:
diff --git a/cekit/builders/osbs.py b/cekit/builders/osbs.py
index 56ec962..f735056 100644
--- a/cekit/builders/osbs.py
+++ b/cekit/builders/osbs.py
@@ -257,7 +257,7 @@ class OSBSBuilder(Builder):
 
             # Get the url of the repository
             url = subprocess.check_output(
-                ["git", "remote", "get-url", "origin"]).strip().decode("utf8")
+                ["git", "config", "--get", "remote.origin.url"]).strip().decode("utf8")
             # Get the latest commit hash
             commit = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode("utf8")
             # Parse the dist-git repository url


Test patch:
diff --git a/tests/test_builder.py b/tests/test_builder.py
index 234a255..a7dad3f 100644
--- a/tests/test_builder.py
+++ b/tests/test_builder.py
@@ -186,7 +186,7 @@ def test_osbs_builder_run_brew_stage(mocker):
     builder.run()
 
     check_output.assert_has_calls([
-        call(['git', 'remote', 'get-url', 'origin']),
+        call(['git', 'config', '--get', 'remote.origin.url']),
         call(['git', 'rev-parse', 'HEAD']),
         call(['/usr/bin/brew-stage', 'call', '--python', 'buildContainer', '--kwargs',
               "{'src': 'git://something.redhat.com/containers/openjdk#c5a0731b558c8a247dd7f85b5f54462cd5b68b23', 'target': 'some-branch-containers-candidate', 'opts': {'scratch': True, 'git_branch': 'some-branch', 'yum_repourls': []}}"])
@@ -206,7 +206,7 @@ def test_osbs_builder_run_brew(mocker):
     builder.run()
 
     check_output.assert_has_calls([
-        call(['git', 'remote', 'get-url', 'origin']),
+        call(['git', 'config', '--get', 'remote.origin.url']),
         call(['git', 'rev-parse', 'HEAD']),
         call(['/usr/bin/brew', 'call', '--python', 'buildContainer', '--kwargs',
               "{'src': 'git://something.redhat.com/containers/openjdk#c5a0731b558c8a247dd7f85b5f54462cd5b68b23', 'target': 'some-branch-containers-candidate', 'opts': {'scratch': True, 'git_branch': 'some-branch', 'yum_repourls': []}}"])
@@ -224,7 +224,7 @@ def test_osbs_builder_run_koji(mocker):
     builder.run()
 
     check_output.assert_has_calls([
-        call(['git', 'remote', 'get-url', 'origin']),
+        call(['git', 'config', '--get', 'remote.origin.url']),
         call(['git', 'rev-parse', 'HEAD']),
         call(['/usr/bin/koji', 'call', '--python', 'buildContainer', '--kwargs',
               "{'src': 'git://something.redhat.com/containers/openjdk#c5a0731b558c8a247dd7f85b5f54462cd5b68b23', 'target': 'some-branch-containers-candidate', 'opts': {'scratch': True, 'git_branch': 'some-branch', 'yum_repourls': []}}"])