Skip to content

Commit a490e81

Browse files
committed
Restore support for PROFILES / ADDITIONAL_PROFILES
1 parent 962dd18 commit a490e81

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

skeleton/scripts/create_site.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def asbool(s):
7878
TIMEZONE = os.getenv("TIMEZONE")
7979
if TIMEZONE:
8080
answers["portal_timezone"] = TIMEZONE
81+
ADDITIONAL_PROFILES = os.getenv("PROFILES", os.getenv("ADDITIONAL_PROFILES", ""))
82+
additional_profiles = []
83+
if ADDITIONAL_PROFILES:
84+
additional_profiles = [profile.strip() for profile in ADDITIONAL_PROFILES.split(",")]
8185

8286
# Get the final site_id and distribution from the updated answers.
8387
site_id = answers["site_id"]
@@ -104,3 +108,10 @@ def asbool(s):
104108
transaction.commit()
105109
app._p_jar.sync()
106110
logger.info(" - Site created!")
111+
112+
if additional_profiles:
113+
for profile_id in additional_profiles:
114+
logger.info(f" - Importing profile {profile_id}")
115+
site.portal_setup.runAllImportStepsFromProfile(f"profile-{profile_id}")
116+
transaction.commit()
117+
app._p_jar.sync()

0 commit comments

Comments
 (0)