kickstart.ini templates for bundles
This page is for bundlers who want the install of their bundle written down as a file that can be reviewed, diffed and versioned. The pattern comes from 6.11 In CI and containers.
Contents
The pattern
- "Keep a template, e.g.
deploy/kickstart.ini.template, under version control with placeholders for secrets." - "Render it at deploy time into the installation root with mode
0600." - "Run a dry run, then the install, and fail the job on a non-zero status."
- Remove the rendered file.
The placeholders below are in ${NAME} form for envsubst; any template tool works.
A SQLite template
Keys from 6.4.2 Sections and keys. Check each against the
kickstart.ini-dist of the version you ship.
[database_choice]
Continue=true
Type=sqlite3
[database_init]
Continue=true
Database=${SITE_DB_FILE}
[language_options]
Continue=true
Primary=eng-US
[site_types]
Continue=true
Site_package=${SITE_PACKAGE}
[site_access]
Continue=true
Access=url
[site_details]
Continue=true
Title=${SITE_TITLE}
URL=${SITE_URL}
Access=site
AdminAccess=admin
EditorAccess=editor
Database=${SITE_DB_FILE}
DatabaseAction=remove
[site_admin]
Continue=true
FirstName=Site
LastName=Administrator
Email=${ADMIN_EMAIL}
Password=
[security]
Continue=true
[registration]
Continue=true
Send=false- For SQLite,
Databaseis "a file name invar/storage/sqlite3/"; give the same value in[database_init]and[site_details]. Password=stays empty: the installer generates one and writes it tovar/log/initial-admin-password.DatabaseAction=removeis right for a first install into a new file and must never meet a database that holds data.
A PostgreSQL variant
Change the database blocks; keep the rest:
[database_choice]
Continue=true
Type=pgsql
[database_init]
Continue=true
Server=${DB_HOST}
Port=5432
Database=${DB_NAME}
User=${DB_USER}
Password=${DB_PASSWORD}and Database=${DB_NAME} in [site_details]. "None of the installers creates a database server's database or user.
Create them first" (Database support). Annotated full examples
for SQLite, MySQL or MariaDB and PostgreSQL are in 6.6.
Rendering and running it
#!/usr/bin/env bash
set -euo pipefail
cd /srv/exponential
umask 077
envsubst < deploy/kickstart.ini.template > kickstart.ini
php bin/php/console exp:kickstarter run --dry-run
php bin/php/console exp:kickstarter run --apply --force
rm -f kickstart.iniThis is the script of 6.11. Points to remember from that
section: "run needs no terminal"; "The run takes a few minutes; give the job enough time"; "In a container, run the
install once ... not at every start".
If you edit a rendered kickstart.ini by hand and the browser wizard is to read it, delete
var/cache/ini/kickstart-*.php first: "ini and run delete [them] themselves ... The browser wizard does not."
Reviewing a template
- To do: Every placeholder is filled from your secret store or the recipient's input, never from a value in the template.
- To do:
DatabaseActionis written explicitly. - To do:
[site_admin] Passwordis empty, or filled from a secret store with a long random value. - To do:
[registration] Send=false. - To do:
URLandEmailbelong to the recipient. - To do: The rendered file is created with mode
0600and removed after the run. - To do: A dry run of the template runs in your CI for every bundle release.
Related pages
- The kickstarter for bundles
- The kickstarter for hosts
- Agency starter kits
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.