Skip to main content

Scaffold a Drupal site template

Project description

Template scripts

A set of scaffolding tools for use at Axelerant. Currently it supports:

Requirements

You need Python 3.6+ and pip to install and use this script. Follow these instructions to install pip if you don't already have it.

The script relies on certain developer tools to be available when running.

  • git - To initialise the project as a repository.
  • composer - To download the dependencies. If composer is not present, the dependencies don't get downloaded.

Alternatively, you can use Docker to run this command. See the section below on usage with Docker for more information.

Installation

Install this script via pip (or pip3). You can use the command to upgrade the command as well.

pip3 install --upgrade axl-template

Usage with Docker (alternate)

Docker support is experimental right now and may throw errors. If you face issues with Docker support, please report an issue. To run init-drupal with Docker, run this command (for bash):

docker run -v $(pwd):/workdir axelerant/template:latest <init-drupal options>

The ENTRYPOINT is set to init-drupal and you can override it if you want to run other commands.

docker run -v $(pwd):/workdir -e init-lando axelerant/template:latest <init-lando options>

You can set aliases so that you don't have to type these commands every time.

alias init-drupal='docker run -v $(pwd):/workdir axelerant/template'
alias init-lando='docker run -v $(pwd):/workdir -e init-lando axelerant/template'

Usage with whalebrew

The Docker image works with whalebrew. You can install the Docker image using the following:

whalebrew install axelerant/template

You can then use the command init-drupal as normal. Whalebrew takes care of the Docker syntax for you.

Updating with Docker

Docker images are tagged along with each tagged version. The latest Docker tag will point to the latest tagged release. You can update the Docker image on your machine similar to any other Docker machine.

docker pull axelerant/template

init-drupal

(Requires Python 3.6+)

Scaffold a Drupal codebase in a subdirectory.

Usage for init-drupal

Usage: init-drupal [OPTIONS] NAME

  Scaffold a Drupal site template

  Create a Drupal site template with NAME. Where NAME is the name of your
  application package (e.g., axelerant/site)

Options:
  --directory DIRECTORY           Directory where the files should be set up
                                  (e.g., drupal). The directory will be
                                  emptied.  [default: .]

  --description TEXT              Description of the package
  -core, --core-package [core|recommended]
                                  Select the core package
  --core                          Select the drupal/core package
  --recommended                   Select the drupal/core-recommended package
  --core-version TEXT             Drupal core version  [default: ^8.9.0]
  --docroot PATH                  The document root
  --cache [redis|memcache]        Add a cache service
  --lando                         Add Lando support
  --gitlab                        Add GitLab support
  -f, --force                     Force delete the target directory if it
                                  exists

  --help                          Show this message and exit.

Example

init-drupal axelerant/site --cache redis --core

The above command will generate a composer.json and in a drupal directory and run composer install. It will use the regular drupal/core package along with the Redis module and few other packages.

init-lando

(Requires Python 3.6+)

Scaffold Lando configuration for a Drupal site in the current directory.

Usage for init-lando

usage: init-lando

No options are required. The tool reads the composer.json file and sets up the Lando configuration accordingly. It also sets up a settings.lando.php file to include Lando specific database and caching configuration.

Lando support can also be added when running init-drupal by passing the --lando option.

init-gitlab

(Requires Python 3.6+)

Scaffold GitLab configuration for a Drupal site in the current directory.

Usage for init-gitlab

usage: init-gitlab

No options are required. The tool reads the composer.json file and sets up the GitLab CI configuration accordingly. It also enables loading settings.local.php from settings.php so that Drupal can use proper database configuration during a CI run.

These files are created by init-gitlab in the .gitlab directory and copied by a shell script (ci.sh). The .gitlab-ci.yml file is created in the project root directly.

GitLab support can also be added when running init-drupal by passing the --gitlab option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axl-template-0.5.3.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axl_template-0.5.3-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file axl-template-0.5.3.tar.gz.

File metadata

  • Download URL: axl-template-0.5.3.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for axl-template-0.5.3.tar.gz
Algorithm Hash digest
SHA256 002c04993addc507a3823b828db042e88ea163075814b57cbeda3823766f1aa0
MD5 a2d03c0f252dece65fd5addf406ff07f
BLAKE2b-256 ff3306d8f5ffdf57b9c74834fbf310351bb873a6019e90100093c1185d84f9a5

See more details on using hashes here.

File details

Details for the file axl_template-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: axl_template-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for axl_template-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb37f04f920c17faf9ae6fdc3f3f7f1479a92f0ad39c3aba7084e456d53ec80
MD5 dd1c7fd9c1b373f533e47298c5d11558
BLAKE2b-256 5cde6827200cd1fe68d2c1cb87adcdbf7ebd54b807233c346aa11ecb77254a3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page