From 642a451f1d5a77895cc7fc2f785f172c4f8c9482 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 1 Nov 2024 23:22:13 +0100 Subject: [PATCH 1/8] Image for 6.1.0b1 --- README.md | 1 + version.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5311a22..035e3bc 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ These images are **not** Buildout based! | Plone Version | Tags | Dockerfile | | --- | --- | --- | | 6 | `6.0.13`, `6.0`, `6`, `latest` | [(6.0.x/Dockerfile)](https://github.com/plone/plone-backend/blob/v6.0.13/Dockerfile)| +| 6.1 | `6.1.0b1`, `6.1` | [(6.1.x/Dockerfile)](https://github.com/plone/plone-backend/blob/v6.1.0b1/Dockerfile)| | 6 (nightly) | `nightly` | [(Dockerfile.nightly)](https://github.com/plone/plone-backend/blob/6.0.x/Dockerfile.nightly) | ### Unsupported tags diff --git a/version.txt b/version.txt index 50e9dae..c52c7d3 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -6.0.13 \ No newline at end of file +6.1.0b1 From b2435dc58d05a92ea8c6165fc122297145c51036 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 1 Nov 2024 23:26:20 +0100 Subject: [PATCH 2/8] Need to update github actions --- .github/workflows/description.yml | 2 +- .github/workflows/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/description.yml b/.github/workflows/description.yml index 4811e3b..c4862ef 100644 --- a/.github/workflows/description.yml +++ b/.github/workflows/description.yml @@ -3,7 +3,7 @@ name: Update Docker Hub Description on: push: branches: - - '6.0.x' + - '6.1.x' paths: - "README.md" - .github/workflows/description.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5eecd78..b308cd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,10 +3,10 @@ name: Test generated image on: push: branches: - - "6.0.x" + - "6.1.x" pull_request: branches: - - "6.0.x" + - "6.1.x" jobs: From f70d074daeb71e9e7ee99118be43d61e7d476ec6 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 2 Nov 2024 00:00:04 +0100 Subject: [PATCH 3/8] 6.1 should not get latest tag: it is not final yet. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e5edcd..94b4317 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ on: env: BASE_IMAGE_NAME: plone/server PLATFORMS: linux/amd64,linux/arm64 - IS_LATEST: true + IS_LATEST: false jobs: From feede00b4b704327ffb3764b46a42cacbfdab303 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 2 Nov 2024 00:56:13 +0100 Subject: [PATCH 4/8] Update create_site.py to create a site using a distribution. --- skeleton/scripts/create_site.py | 126 ++++++++++++++++++-------------- skeleton/scripts/default.json | 8 ++ 2 files changed, 81 insertions(+), 53 deletions(-) create mode 100644 skeleton/scripts/default.json diff --git a/skeleton/scripts/create_site.py b/skeleton/scripts/create_site.py index d530d26..c292882 100644 --- a/skeleton/scripts/create_site.py +++ b/skeleton/scripts/create_site.py @@ -1,13 +1,29 @@ from AccessControl.SecurityManagement import newSecurityManager -from Products.CMFPlone.factory import _DEFAULT_PROFILE -from Products.CMFPlone.factory import addPloneSite +from pathlib import Path +from plone.distribution.api import site as site_api from Testing.makerequest import makerequest -import transaction +import json +import logging import os +import transaction + + +logging.basicConfig(format="%(message)s") +# Silence some loggers +for logger_name in [ + "GenericSetup.componentregistry", + "Products.MimetypesRegistry.MimeTypesRegistry", +]: + logging.getLogger(logger_name).setLevel(logging.ERROR) -truthy = frozenset(('t', 'true', 'y', 'yes', 'on', '1')) +logger = logging.getLogger("Plone Site Creation") +logger.setLevel(logging.DEBUG) + +SCRIPT_DIR = Path().cwd() / "scripts" + +truthy = frozenset(("t", "true", "y", "yes", "on", "1")) def asbool(s): @@ -22,7 +38,7 @@ def asbool(s): return s.lower() in truthy -app = makerequest(app) +app = makerequest(globals()["app"]) request = app.REQUEST @@ -31,56 +47,60 @@ def asbool(s): newSecurityManager(None, admin) # VARS -TYPE = os.getenv("TYPE", "volto") -SITE_ID = os.getenv("SITE_ID", "Plone") -SETUP_CONTENT = asbool(os.getenv("SETUP_CONTENT")) +ANSWERS = os.getenv("ANSWERS", "default") DELETE_EXISTING = asbool(os.getenv("DELETE_EXISTING")) -LANGUAGE = os.getenv("LANGUAGE", "en") -TIMEZONE = os.getenv("TIMEZONE", "Europe/Berlin") -ADDITIONAL_PROFILES = os.getenv("PROFILES", os.getenv("ADDITIONAL_PROFILES", "")) - -PROFILES = { - "volto": [ - "plone.app.caching:default", - "plonetheme.barceloneta:default", - "plone.volto:default", - "plone.volto:default-homepage", - ], - "classic": [ - "plone.app.caching:default", - "plonetheme.barceloneta:default", - ], -} - - -def profile_ids(site_type): - extension_ids = PROFILES[site_type] - if ADDITIONAL_PROFILES: - extension_ids.extend( - [ - profile.strip() - for profile in ADDITIONAL_PROFILES.split(" ") - if profile.strip() - ] - ) - return extension_ids - - -payload = { - "title": "Plone", - "profile_id": _DEFAULT_PROFILE, - "extension_ids": profile_ids(TYPE), - "setup_content": SETUP_CONTENT, - "default_language": LANGUAGE, - "portal_timezone": TIMEZONE, -} - -if SITE_ID in app.objectIds() and DELETE_EXISTING: - app.manage_delObjects([SITE_ID]) +DISTRIBUTION = os.getenv("DISTRIBUTION", "") + +if not DISTRIBUTION: + # We used to support setting TYPE 'volto' or 'classic'. + TYPE = os.getenv("TYPE", "") + if TYPE == "classic": + DISTRIBUTION = "classic" + elif TYPE == "volto": + DISTRIBUTION = "default" + +# Load default site creation parameters +answers_file = SCRIPT_DIR / f"{ANSWERS}.json" +answers = json.loads(answers_file.read_text()) + +# Override the defaults from the OS environment +if DISTRIBUTION: + answers["distribution"] = DISTRIBUTION +SITE_ID = os.getenv("SITE_ID") +if SITE_ID: + answers["site_id"] = SITE_ID +LANGUAGE = os.getenv("LANGUAGE") +if LANGUAGE: + answers["default_language"] = LANGUAGE +SETUP_CONTENT = os.getenv("SETUP_CONTENT") +if SETUP_CONTENT is not None: + answers["setup_content"] = asbool(SETUP_CONTENT) +TIMEZONE = os.getenv("TIMEZONE") +if TIMEZONE: + answers["portal_timezone"] = TIMEZONE + +# Get the final site_id and distribution from the updated answers. +site_id = answers["site_id"] +DISTRIBUTION = answers["distribution"] +logger.info(f"Creating a new Plone site @ {site_id}") +logger.info(f" - Using the {DISTRIBUTION} distribution and answers from {answers_file}") + + +if site_id in app.objectIds() and DELETE_EXISTING: + app.manage_delObjects([site_id]) transaction.commit() app._p_jar.sync() - -if SITE_ID not in app.objectIds(): - site = addPloneSite(app, SITE_ID, **payload) + logger.info(f" - Deleted existing site with id {site_id}") +else: + logger.info( + f" - Stopping site creation, as there is already a site with id {site_id}. " + "Set DELETE_EXISTING=1 to delete the existing site before creating a new one." + ) + +if site_id not in app.objectIds(): + site = site_api._create_site( + context=app, distribution_name=DISTRIBUTION, answers=answers + ) transaction.commit() app._p_jar.sync() + logger.info(" - Site created!") diff --git a/skeleton/scripts/default.json b/skeleton/scripts/default.json new file mode 100644 index 0000000..baf6d0a --- /dev/null +++ b/skeleton/scripts/default.json @@ -0,0 +1,8 @@ +{ + "site_id": "Plone", + "title": "Welcome to Plone 6", + "description": "Site created with a new Plone Distribution", + "default_language": "en", + "portal_timezone": "Europe/Berlin", + "setup_content": true +} \ No newline at end of file From 962dd18758fd73b0cbe2d3686cf613f14390daca Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 2 Nov 2024 12:06:04 -0700 Subject: [PATCH 5/8] update tests for new text from distribution-based landing page --- test/tests/plone-arbitrary-user/run.sh | 4 ++-- test/tests/plone-basics/run.sh | 4 ++-- test/tests/plone-listenport/run.sh | 2 +- test/tests/plone-relstorage/run.sh | 4 ++-- test/tests/plone-shared-blob-dir/run.sh | 4 ++-- test/tests/plone-site/run.sh | 2 +- test/tests/plone-zeoclient/run.sh | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/tests/plone-arbitrary-user/run.sh b/test/tests/plone-arbitrary-user/run.sh index caf50c5..8c324e5 100755 --- a/test/tests/plone-arbitrary-user/run.sh +++ b/test/tests/plone-arbitrary-user/run.sh @@ -34,7 +34,7 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get 'http://plone:8080')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a Plone site"* ]] \ No newline at end of file +[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] \ No newline at end of file diff --git a/test/tests/plone-basics/run.sh b/test/tests/plone-basics/run.sh index f252529..cb476a2 100755 --- a/test/tests/plone-basics/run.sh +++ b/test/tests/plone-basics/run.sh @@ -32,7 +32,7 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get 'http://plone:8080')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a Plone site"* ]] \ No newline at end of file +[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] \ No newline at end of file diff --git a/test/tests/plone-listenport/run.sh b/test/tests/plone-listenport/run.sh index 58de13a..b2bb34b 100755 --- a/test/tests/plone-listenport/run.sh +++ b/test/tests/plone-listenport/run.sh @@ -23,4 +23,4 @@ get() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8081" # Plone is up and running -[[ "$(get 'http://plone:8081')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8081')" == *"Welcome to Plone!"* ]] diff --git a/test/tests/plone-relstorage/run.sh b/test/tests/plone-relstorage/run.sh index 0905e70..b93065d 100755 --- a/test/tests/plone-relstorage/run.sh +++ b/test/tests/plone-relstorage/run.sh @@ -39,7 +39,7 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get 'http://plone:8080')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a Plone site"* ]] +[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-shared-blob-dir/run.sh b/test/tests/plone-shared-blob-dir/run.sh index 99dd4f0..68820de 100755 --- a/test/tests/plone-shared-blob-dir/run.sh +++ b/test/tests/plone-shared-blob-dir/run.sh @@ -39,7 +39,7 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get 'http://plone:8080')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a Plone site"* ]] +[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-site/run.sh b/test/tests/plone-site/run.sh index 3fb4a44..ccde848 100755 --- a/test/tests/plone-site/run.sh +++ b/test/tests/plone-site/run.sh @@ -33,4 +33,4 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get "http://plone:8080/$site")" == *"Welcome to Plone"* ]] +[[ "$(get "http://plone:8080/$site")" == *"Welcome to Plone!"* ]] diff --git a/test/tests/plone-zeoclient/run.sh b/test/tests/plone-zeoclient/run.sh index 7d51cc3..91f03cf 100755 --- a/test/tests/plone-zeoclient/run.sh +++ b/test/tests/plone-zeoclient/run.sh @@ -39,7 +39,7 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get 'http://plone:8080')" == *"Plone is up and running"* ]] +[[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a Plone site"* ]] +[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] From a490e819c23f30d6f6cbfefa9c0352149401ea82 Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 2 Nov 2024 12:23:17 -0700 Subject: [PATCH 6/8] Restore support for PROFILES / ADDITIONAL_PROFILES --- skeleton/scripts/create_site.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/skeleton/scripts/create_site.py b/skeleton/scripts/create_site.py index c292882..c92c9a3 100644 --- a/skeleton/scripts/create_site.py +++ b/skeleton/scripts/create_site.py @@ -78,6 +78,10 @@ def asbool(s): TIMEZONE = os.getenv("TIMEZONE") if TIMEZONE: answers["portal_timezone"] = TIMEZONE +ADDITIONAL_PROFILES = os.getenv("PROFILES", os.getenv("ADDITIONAL_PROFILES", "")) +additional_profiles = [] +if ADDITIONAL_PROFILES: + additional_profiles = [profile.strip() for profile in ADDITIONAL_PROFILES.split(",")] # Get the final site_id and distribution from the updated answers. site_id = answers["site_id"] @@ -104,3 +108,10 @@ def asbool(s): transaction.commit() app._p_jar.sync() logger.info(" - Site created!") + + if additional_profiles: + for profile_id in additional_profiles: + logger.info(f" - Importing profile {profile_id}") + site.portal_setup.runAllImportStepsFromProfile(f"profile-{profile_id}") + transaction.commit() + app._p_jar.sync() From f1ead942f15b2755fe541c84315156de9a4d4443 Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 2 Nov 2024 12:41:48 -0700 Subject: [PATCH 7/8] @@plone-addsite is no more --- test/tests/plone-arbitrary-user/run.sh | 2 +- test/tests/plone-basics/run.sh | 2 +- test/tests/plone-relstorage/run.sh | 3 ++- test/tests/plone-shared-blob-dir/run.sh | 3 ++- test/tests/plone-site/run.sh | 2 +- test/tests/plone-zeoclient/run.sh | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/tests/plone-arbitrary-user/run.sh b/test/tests/plone-arbitrary-user/run.sh index 8c324e5..d59ffe3 100755 --- a/test/tests/plone-arbitrary-user/run.sh +++ b/test/tests/plone-arbitrary-user/run.sh @@ -37,4 +37,4 @@ get_auth() { [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] \ No newline at end of file +[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-basics/run.sh b/test/tests/plone-basics/run.sh index cb476a2..ddeec66 100755 --- a/test/tests/plone-basics/run.sh +++ b/test/tests/plone-basics/run.sh @@ -35,4 +35,4 @@ get_auth() { [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] \ No newline at end of file +[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-relstorage/run.sh b/test/tests/plone-relstorage/run.sh index b93065d..447206d 100755 --- a/test/tests/plone-relstorage/run.sh +++ b/test/tests/plone-relstorage/run.sh @@ -42,4 +42,5 @@ get_auth() { [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] +[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] + diff --git a/test/tests/plone-shared-blob-dir/run.sh b/test/tests/plone-shared-blob-dir/run.sh index 68820de..f75e850 100755 --- a/test/tests/plone-shared-blob-dir/run.sh +++ b/test/tests/plone-shared-blob-dir/run.sh @@ -42,4 +42,5 @@ get_auth() { [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] +[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] + diff --git a/test/tests/plone-site/run.sh b/test/tests/plone-site/run.sh index ccde848..3fb4a44 100755 --- a/test/tests/plone-site/run.sh +++ b/test/tests/plone-site/run.sh @@ -33,4 +33,4 @@ get_auth() { . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running -[[ "$(get "http://plone:8080/$site")" == *"Welcome to Plone!"* ]] +[[ "$(get "http://plone:8080/$site")" == *"Welcome to Plone"* ]] diff --git a/test/tests/plone-zeoclient/run.sh b/test/tests/plone-zeoclient/run.sh index 91f03cf..4dad0ad 100755 --- a/test/tests/plone-zeoclient/run.sh +++ b/test/tests/plone-zeoclient/run.sh @@ -42,4 +42,4 @@ get_auth() { [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] # Create a Plone site -[[ "$(get_auth 'http://plone:8080/@@plone-addsite' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] +[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] From d459d7b568c2e5b0eb229f303380b5f8e19b4c83 Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 2 Nov 2024 13:12:38 -0700 Subject: [PATCH 8/8] Remove test for UI to add a new site It's not a separate page now, and it's a React app so harder to test for --- test/tests/plone-arbitrary-user/run.sh | 12 ------------ test/tests/plone-basics/run.sh | 12 ------------ test/tests/plone-relstorage/run.sh | 12 ------------ test/tests/plone-shared-blob-dir/run.sh | 12 ------------ test/tests/plone-zeoclient/run.sh | 11 ----------- 5 files changed, 59 deletions(-) diff --git a/test/tests/plone-arbitrary-user/run.sh b/test/tests/plone-arbitrary-user/run.sh index d59ffe3..4c1b998 100755 --- a/test/tests/plone-arbitrary-user/run.sh +++ b/test/tests/plone-arbitrary-user/run.sh @@ -22,19 +22,7 @@ get() { -c "from urllib.request import urlopen; con = urlopen('$1'); print(con.read())" } -get_auth() { - docker run --rm -i \ - --link "$cname":plone \ - --entrypoint /app/bin/python \ - "$image" \ - -c "from urllib.request import urlopen, Request; request = Request('$1'); request.add_header('Authorization', 'Basic $2'); print(urlopen(request).read())" -} - - . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] - -# Create a Plone site -[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-basics/run.sh b/test/tests/plone-basics/run.sh index ddeec66..d6f90d4 100755 --- a/test/tests/plone-basics/run.sh +++ b/test/tests/plone-basics/run.sh @@ -20,19 +20,7 @@ get() { -c "from urllib.request import urlopen; con = urlopen('$1'); print(con.read())" } -get_auth() { - docker run --rm -i \ - --link "$cname":plone \ - --entrypoint /app/bin/python \ - "$image" \ - -c "from urllib.request import urlopen, Request; request = Request('$1'); request.add_header('Authorization', 'Basic $2'); print(urlopen(request).read())" -} - - . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] - -# Create a Plone site -[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] diff --git a/test/tests/plone-relstorage/run.sh b/test/tests/plone-relstorage/run.sh index 447206d..51bd704 100755 --- a/test/tests/plone-relstorage/run.sh +++ b/test/tests/plone-relstorage/run.sh @@ -28,19 +28,7 @@ get() { -c "from urllib.request import urlopen; con = urlopen('$1'); print(con.read())" } -get_auth() { - docker run --rm -i \ - --link "$pname":plone \ - --entrypoint /app/bin/python \ - "$image" \ - -c "from urllib.request import urlopen, Request; request = Request('$1'); request.add_header('Authorization', 'Basic $2'); print(urlopen(request).read())" -} - . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] - -# Create a Plone site -[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] - diff --git a/test/tests/plone-shared-blob-dir/run.sh b/test/tests/plone-shared-blob-dir/run.sh index f75e850..0fc1164 100755 --- a/test/tests/plone-shared-blob-dir/run.sh +++ b/test/tests/plone-shared-blob-dir/run.sh @@ -28,19 +28,7 @@ get() { -c "from urllib.request import urlopen; con = urlopen('$1'); print(con.read())" } -get_auth() { - docker run --rm -i \ - --link "${pname}":plone \ - --entrypoint /app/bin/python \ - "$image" \ - -c "from urllib.request import urlopen, Request; request = Request('$1'); request.add_header('Authorization', 'Basic $2'); print(urlopen(request).read())" -} - . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] - -# Create a Plone site -[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]] - diff --git a/test/tests/plone-zeoclient/run.sh b/test/tests/plone-zeoclient/run.sh index 4dad0ad..35186cf 100755 --- a/test/tests/plone-zeoclient/run.sh +++ b/test/tests/plone-zeoclient/run.sh @@ -28,18 +28,7 @@ get() { -c "from urllib.request import urlopen; con = urlopen('$1'); print(con.read())" } -get_auth() { - docker run --rm -i \ - --link "$pname":plone \ - --entrypoint /app/bin/python \ - "$image" \ - -c "from urllib.request import urlopen, Request; request = Request('$1'); request.add_header('Authorization', 'Basic $2'); print(urlopen(request).read())" -} - . "$dir/../../retry.sh" --tries "$PLONE_TEST_TRIES" --sleep "$PLONE_TEST_SLEEP" get "http://plone:8080" # Plone is up and running [[ "$(get 'http://plone:8080')" == *"Welcome to Plone!"* ]] - -# Create a Plone site -[[ "$(get_auth 'http://plone:8080' "$(echo -n 'admin:admin' | base64)")" == *"Create a new site"* ]]