From 763b2642a5c850a4d5b3cdc910962985c847239c Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 2 Apr 2020 08:56:42 +0200
Subject: [PATCH] Bump base image to 19.10 for gcc 9.

---
 README.md                          |  8 ++++++++
 ogscm/build_jenkins_definitions.py |  8 ++++----
 ogscm/cli.py                       | 13 ++-----------
 ogscm/cli_args.py                  |  2 +-
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index fe24e1d..19e8625 100644
--- a/README.md
+++ b/README.md
@@ -170,3 +170,11 @@ python ThirdParty/container-maker/ogscm/cli.py -B -C -R --ogs . --pm system --cv
 - Rename the file `config/deploy_hosts_example.yml` to `config/deploy_hosts.yml`
 - `host` has to be a SSH host to which you have passwordless access
 - Deploy to the host with `... -D myhost`
+
+
+## PyPi Publication
+
+- Check if requirements.txt has changed, change `setup.py` accordingly
+- Bump version in `version.py`
+- `python setup.py sdist`
+- `twine upload dist/*`
diff --git a/ogscm/build_jenkins_definitions.py b/ogscm/build_jenkins_definitions.py
index 41bff9b..0ca3a31 100644
--- a/ogscm/build_jenkins_definitions.py
+++ b/ogscm/build_jenkins_definitions.py
@@ -16,7 +16,7 @@ subprocess.run(f"python ogscm/cli.py --out {args.out} --file Dockerfile.clang.fu
                "--base_image ubuntu:18.04 --compiler clang --jenkins --iwyy "
                "--compiler_version 9",
                shell=True)
-subprocess.run(f"python ogscm/cli.py --out {args.out} --file Dockerfile.clang.gui "
-               "--base_image ubuntu:18.04 --compiler clang --jenkins --iwyy "
-               "--compiler_version 9 --gui",
-               shell=True)
+# subprocess.run(f"python ogscm/cli.py --out {args.out} --file Dockerfile.clang.gui "
+#                "--base_image ubuntu:18.04 --compiler clang --jenkins --iwyy "
+#                "--compiler_version 9 --gui",
+#                shell=True)
diff --git a/ogscm/cli.py b/ogscm/cli.py
index 840bb96..7134712 100644
--- a/ogscm/cli.py
+++ b/ogscm/cli.py
@@ -113,6 +113,7 @@ def main():  # pragma: no cover
                     args.compiler_version = None  # Use default
             if args.compiler == 'clang':
                 compiler = llvm(extra_repository=True,
+                                extra_tools=True,
                                 version=args.compiler_version)
             else:
                 compiler = gnu(fortran=False,
@@ -122,18 +123,8 @@ def main():  # pragma: no cover
             Stage0 += compiler
             # Upgrade stdc++ lib after installing new compiler
             # https://stackoverflow.com/a/46613656/80480
-            if args.compiler == 'gcc' and args.compiler_version != None:
+            if args.compiler == 'gcc' and args.compiler_version is not None:
                 Stage0 += packages(apt=['libstdc++6'])
-            if args.compiler == 'clang':
-                Stage0 += packages(
-                    apt=[
-                        "clang-tidy-{}".format(args.compiler_version),
-                        "clang-format-{}".format(args.compiler_version)
-                    ],
-                    yum=[
-                        "llvm-toolset-{}-clang-tools-extra".format(
-                            args.compiler_version)
-                    ])
 
         # Prepare runtime stage
         Stage1 = hpccm.Stage()
diff --git a/ogscm/cli_args.py b/ogscm/cli_args.py
index 39e530a..9ae8928 100644
--- a/ogscm/cli_args.py
+++ b/ogscm/cli_args.py
@@ -125,7 +125,7 @@ class Cli_Args(argparse.ArgumentParser):
         switches_g = self.add_argument_group('Additional options')
         switches_g.add_argument('--base_image',
                                 type=str,
-                                default='ubuntu:19.04',
+                                default='ubuntu:19.10',
                                 help='The base image.')
         switches_g.add_argument(
             '--compiler',
-- 
GitLab