]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: learn to pull cephadm from github
authorSage Weil <sage@redhat.com>
Fri, 20 Dec 2019 19:02:14 +0000 (13:02 -0600)
committerSage Weil <sage@redhat.com>
Wed, 22 Jan 2020 14:47:03 +0000 (08:47 -0600)
Fixes: https://tracker.ceph.com/issues/43755
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/cephadm.py

index f62f2cc1d83f3925a76ba034436a9b105745e10c..60118d02522a75f5ae43da9e740136a20c0e05e5 100644 (file)
@@ -88,24 +88,42 @@ def download_cephadm(ctx, config, ref):
         ref = config.get('cephadm_branch', ref)
         git_url = teuth_config.get_ceph_git_url()
         log.info('Downloading cephadm (repo %s ref %s)...' % (git_url, ref))
-        ctx.cluster.run(
-            args=[
-                'git', 'archive',
-                '--remote=' + git_url,
-                ref,
-                'src/cephadm/cephadm',
-                run.Raw('|'),
-                'tar', '-xO', 'src/cephadm/cephadm',
-                run.Raw('>'),
-                ctx.cephadm,
-                run.Raw('&&'),
-                'test', '-s',
-                ctx.cephadm,
-                run.Raw('&&'),
-                'chmod', '+x',
-                ctx.cephadm,
-            ],
-        )
+        if git_url.startswith('https://github.com/'):
+            # git archive doesn't like https:// URLs, which we use with github.
+            rest = git_url.split('https://github.com/', 1)[1]
+            ctx.cluster.run(
+                args=[
+                    'curl', '--silent',
+                    'https://raw.githubusercontent.com/' + rest + '/' + ref + '/src/cephadm/cephadm',
+                    run.Raw('>'),
+                    ctx.cephadm,
+                    run.Raw('&&'),
+                    'test', '-s',
+                    ctx.cephadm,
+                    run.Raw('&&'),
+                    'chmod', '+x',
+                    ctx.cephadm,
+                ],
+            )
+        else:
+            ctx.cluster.run(
+                args=[
+                    'git', 'archive',
+                    '--remote=' + git_url,
+                    ref,
+                    'src/cephadm/cephadm',
+                    run.Raw('|'),
+                    'tar', '-xO', 'src/cephadm/cephadm',
+                    run.Raw('>'),
+                    ctx.cephadm,
+                    run.Raw('&&'),
+                    'test', '-s',
+                    ctx.cephadm,
+                    run.Raw('&&'),
+                    'chmod', '+x',
+                    ctx.cephadm,
+                ],
+            )
 
     try:
         yield