changeset 7643:fae314043555

build(docker): disable pip_sdist mode in github ci: COPY README.txt dist/* install/dist/ crashes the docker build if the dist directory is missing. This prevents anchore/grype from scanning the image. This is a new issue as it doesn't happen on my system. The README.txt file is there explicitly to prevent COPY from failing if nothing matches the wildcard. This used to work, but .... So I am disabling building from local sdist. This only affects maintainers. Building from sdist is done to generate a docker that matches a source distribution that has yet to be uploaded to pypi. Other use cases can build using the default of local. I haven't found a way to make a dist subdir in the docker build context directory. I can't even figure out how to identify the context directory name inside the build container. Also updated installation docs.
author John Rouillard <rouilj@ieee.org>
date Sun, 24 Sep 2023 22:24:51 -0400
parents 0b03b4dd7089
children 974599384dc5
files doc/installation.txt scripts/Docker/Dockerfile
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/doc/installation.txt	Sun Sep 24 21:35:47 2023 -0400
+++ b/doc/installation.txt	Sun Sep 24 22:24:51 2023 -0400
@@ -1754,6 +1754,7 @@
   by some Python users.
 
 ``--build-arg="source=pip_sdist"``
+  Disabled.
   This is meant for maintainer/developer use. It installs using
   pip from a source distribution (sdist) tarball built by
   following the RELEASE.txt. It is meant for testing
--- a/scripts/Docker/Dockerfile	Sun Sep 24 21:35:47 2023 -0400
+++ b/scripts/Docker/Dockerfile	Sun Sep 24 22:24:51 2023 -0400
@@ -129,7 +129,7 @@
 COPY roundup install/roundup/
 COPY share install/share/
 # dist/* might not exist, so include README.txt so we don't get an error
-COPY README.txt dist/* install/dist/
+#COPY README.txt dist/* install/dist/
 
 # verify source has one of two valid values then
 # install in python3 standard directories from local copy
@@ -152,17 +152,18 @@
 		pip -V && \
 		pip install --no-cache-dir . ;; \
 	"pip_sdist") \
+	    printf "\n\npip_sdist disabled\n\n" && exit 1 ; \
 	    dist=$(find install/dist | sed -ne '/roundup-[0-9].*\.tar\.gz$/p' | tail -n 1); \
 	    if [ -z "$dist" ] ; then \
-		printf "Unable to find a source distribution file in dist\n"; \
-		printf "Exiting\n"; \
+		printf "\n\nUnable to find a source distribution file in dist\n"; \
+		printf "Exiting\n\n"; \
 		exit 1; \
             fi; \
             printf "Building with distribution: %s\n" "$dist"; \
             pip install --no-cache-dir "install/dist/$dist";; \
         *) \
-            echo "invalid value for source: $source"; \
-	    echo "must be local, pypi, pip_local or pip_sdist"; \
+            printf "\n\ninvalid value for source: $source\n"; \
+	    printf "must be local, pypi, pip_local or pip_sdist\n\n"; \
             exit 1;; \
     esac
 

Roundup Issue Tracker: http://roundup-tracker.org/