Creating platforms with the script 'kplatforms.sh'

Last updated on
30 April 2025

The kplatforms.sh script creates an Aegir platform from start to finish (from the download up to the front-end).

You must run this script as the 'aegir' user.

The script is included in the package. Naming conventions may change at some point.

Usage

kplatforms.sh [-a htpasswd_file] [-C | -c config_file] [-d drush_command] [-f] [-G] [-I | -i inclusions] [-M | -m additional_makefiles] [-n platform_name] [-o hostmaster_instance_name] [-p platforms_path] [-s platform_name_suffix] [-v drupal_version] [-w web_server]

kplatforms.sh -h

-a htpasswd_file

  • Enforces access restricted by users (htauth) in htaccess using the provided htpasswd file with its absolute path.
  • Htpasswd file can be generate by this command:
    htpasswd -b -c filename username password

-C or -c config_file

  • '-c config_file' reads a configuration file where variables can be defined instead of using arguments.
  • Default is "/var/aegir/config/kplatforms.conf" if readable and if neither '-C' nor '-c' is given.
  • '-C' tells not to read the default configuration file.
  • You can copy the file "example.conf" then edit it:
    cp example.conf /var/aegir/config/kplatforms.conf

-d drush_command

  • Drush command with, if necessary, its absolute path.
  • Default is "drush".

-f

  • Using "drush --force-complete" to create the platform.
  • Default is not to use the flag "--force-complete".

-G

  • '-G' tells not to import the platform into Aegir.
  • Default is to import the platform into Aegir if '-G' is not given.

-H or -h

  • Help: print usage and exit.

-I or -i inclusions

  • '-i inclusions' is a coma separated list (no space) of the desired inclusions where 'inclusions' are 'inclusion[,inclusion]...'
  • Default is "modules,themes" if neither '-I' nor '-i' is given.
  • The directories "includes/*/" contain the available inclusions.
    • Do not write any version number.
    • Remove any space in the name.
    • Example: write 'OpenAtrium' instead of 'Open Atrium 1.x'.
  • '-I' tells not to include any inclusion, only the core makefile.
  • More details on inclusions here.

-M or -m additional_makefiles

  • '-m additional_makefiles' is a coma separated list (no space) of additional makefiles that will be included where 'additional_makefiles' are '/path/to/makefile.make[,/path/to/makefile.make]...'
  • Default includes "/var/aegir/makefiles/kplatforms.make" if readable and if neither '-M' nor '-m' is given.
  • '-M' tells not to include the default additional makefile.

-n platform_name

  • The name of the platform.
  • Choose the name you want.
  • Default is "drupal-'drupal_version'" where 'drupal_version' is defined by -v.
  • Note that '-YYYY.MM.DD' will automatically be appended if variable 'platform_name_dated' is not defined in the config file.

-o hostmaster_instance_name

  • Hostmaster instance name which will be used like:
    drush @hostmaster ...
  • Default is "hostmaster".

-p platforms_path

  • Path where to create platforms.
  • Default is "/var/aegir/platforms".

-s platform_name_suffix

  • This will be appended at the far end of the platform name.
  • Examples are 'staging', 'production', 'test'.
  • Choose the suffix you want.

-v drupal_version

  • The Drupal core major version number.
  • Default is "7".

-w web_server

  • Web server name which will be used like:
    drush provision-save --web_server=@server_master ...
  • Default is "master".
  • The part 'server_' will automatically be added.

Examples

kplatforms.sh

kplatforms.sh -v 6 -i modules,themes,openatrium,civicrm -n drupal-6-civicrm-4 -s staging -m /var/aegir/makefiles/more.make -a /var/aegir/config/htpasswd/staging

kplatforms.sh -c /var/aegir/config/kplatforms/my_platform.conf

Help improve this page

Page status: Not set

You can: