Make it possible to deploy a single node.
[arvados-dev.git] / jenkins / run_upload_packages.py
index cce377ed4745e3785b05de849dd53b7d0538cd62..aadc004cbfc28b80ef08ac485c42ba7f2642ea1b 100755 (executable)
@@ -116,19 +116,17 @@ class PythonPackageSuite(PackageSuite):
         if src_dir in self.seen_packages:
             return
         self.seen_packages.add(src_dir)
-        # NOTE: If we ever start uploading Python 3 packages, we'll need to
-        # figure out some way to adapt cmd to match.  It might be easiest
-        # to give all our setup.py files the executable bit, and run that
-        # directly.
         # We also must run `sdist` before `upload`: `upload` uploads any
         # distributions previously generated in the command.  It doesn't
         # know how to upload distributions already on disk.  We write the
         # result to a dedicated directory to avoid interfering with our
         # timestamp tracking.
-        cmd = ['python2.7', 'setup.py']
+        cmd = ['python3', 'setup.py']
         if not self.logger.isEnabledFor(logging.INFO):
             cmd.append('--quiet')
-        cmd.extend(['sdist', '--dist-dir', '.upload_dist', 'upload'])
+        cmd.extend(['bdist_wheel', '--dist-dir', '.upload_dist'])
+        cmd.extend(['sdist', '--dist-dir', '.upload_dist'])
+        cmd.extend(['upload'])
         upload_returncode, repushed = run_and_grep(
             cmd, 'stderr', *self.REUPLOAD_REGEXPS, cwd=src_dir)
         if (upload_returncode != 0) and not repushed:
@@ -204,6 +202,7 @@ rm "$@"
             'ubuntu1404': 'trusty-'+repo,
             'ubuntu1604': 'xenial-'+repo,
             'ubuntu1804': 'bionic-'+repo,
+            'ubuntu2004': 'focal-'+repo,
             }
 
     def post_uploads(self, paths):
@@ -240,10 +239,8 @@ def _define_suite(suite_class, *rel_globs, **kwargs):
 
 PACKAGE_SUITES = {
     'python': _define_suite(PythonPackageSuite,
-                            'sdk/pam/dist/*.tar.gz',
                             'sdk/python/dist/*.tar.gz',
                             'sdk/cwl/dist/*.tar.gz',
-                            'services/nodemanager/dist/*.tar.gz',
                             'services/fuse/dist/*.tar.gz',
                         ),
     'gems': _define_suite(GemPackageSuite,
@@ -267,7 +264,7 @@ def parse_arguments(arguments):
     parser.add_argument('--verbose', '-v', action='count', default=0,
                         help="Log more information and subcommand output")
     parser.add_argument(
-        '--repo', choices=['dev', 'testing']
+        '--repo', choices=['dev', 'testing'],
         help="Whether to upload to dev (nightly) or testing (release candidate) repository")
 
     parser.add_argument(
@@ -280,6 +277,16 @@ def parse_arguments(arguments):
 
     if args.workspace is None:
         parser.error("workspace not set from command line or environment")
+
+    for target in ['debian8', 'debian9', 'debian10', 'ubuntu1404', 'ubuntu1604', 'ubuntu1804', 'ubuntu2004']:
+        PACKAGE_SUITES[target] = _define_suite(
+            DebianPackageSuite, os.path.join('packages', target, '*.deb'),
+            target=target, repo=args.repo)
+    for target in ['centos7']:
+        PACKAGE_SUITES[target] = _define_suite(
+            RedHatPackageSuite, os.path.join('packages', target, '*.rpm'),
+            target=target, repo=args.repo)
+
     for target in args.targets:
         try:
             suite_class = PACKAGE_SUITES[target].func
@@ -311,15 +318,6 @@ def main(arguments, stdout=sys.stdout, stderr=sys.stderr):
     args = parse_arguments(arguments)
     setup_logger(stderr, args)
 
-    for target in ['debian8', 'debian9', 'debian10', 'ubuntu1404', 'ubuntu1604', 'ubuntu1804']:
-        PACKAGE_SUITES[target] = _define_suite(
-            DebianPackageSuite, os.path.join('packages', target, '*.deb'),
-            target=target, repo=args.repo)
-    for target in ['centos7']:
-        PACKAGE_SUITES[target] = _define_suite(
-            RedHatPackageSuite, os.path.join('packages', target, '*.rpm'),
-            target=target, repo=args.repo)
-
     for target in args.targets:
         ts_file = TimestampFile(os.path.join(args.workspace, 'packages',
                                              '.last_upload_%s' % target))