Skip to content
Aaron McGowan edited this page Dec 6, 2013 · 12 revisions

A unique and robust devops and developer toolset is needed for the ImageX InstallKit. This tool must allow for the following listed items below as well as be built using Drush to enable deep integration with already existing Drupal development tools.

  • Project Initialization and Setup
  • Development (on-going)
  • QA & Testing
  • Deployment
  • On-going deployment and above.

This tool will work in conjunction with a single Git repository.

Working Directory Structure

- /working-dir
  -- /.ops: Stores local "cache" information of the build
    -- /backups: Contains complete backup instances
    -- *settings.php: A PHP settings file for handling common configuration for this instance.
  -- /releases: This is where live "releases" live
    -- /release-[date-time]
      -- /source: Contains a copy of the working codebase
      -- /shared: Contains a copy of the shared assets (files, etc.)
      -- /database: Contains a database dump able to be used for restore
  -- /dev: This is where active development goes.
  -- /public: This is the directory in which is web accessible
    -- Symlinks to "important" things such as the codebase; ignores commonly shared things like sites/*/files and sites/*/settings.php

Command Set

drush ops-setup [name]

Initializes a new installkit instance for active development.

drush ops-build [name] [--no-install]

Builds a particular instance's codebase and performs an installation for the specified instance's [name]. If [name] is not specified, then this command must be executed within an already existing working directory structure.

drush ops-update

Performs a complete environment update (e.g. fetching latest codebase, executing any required make commands, performing a drush updb, cache clearing (if required) and so on).

drush ops-release [release]

Creates a new release locally that is available to be deployed to environment instances.

drush ops-backup

Performs a complete backup.

drush ops-destroy [name] [--force] [--remote]

Destroys a complete working instance locally and potentially remote instances if --remote flag is specified.

drush ops-deploy [release] [--environment]

Deploys a specified release to production or another environment if specified by the --environment flag. During deployment, the remote environment's deployed instance will go into maintenance mode during this time and be taken out of maintenance once deployment is completed.

drush ops-sync

Performs a synchronization of shared and common assets (database, files, etc.) from production to local environment.

drush ops-test

Perform a complete test (e.g. execute unit tests, behat tests, etc.) on the current and local working dev environment.

Configuration

<?php

Project Specific Hooks

This tool must allow for project specific hooks to be executed. Such hooks may include: pre-deployment (execute on local or remote), post-deployment, pre-build, post-build, pre-update, post-update, and so on. This will allow each project to be able to execute specific code or commands to ensure the operation has executed fully. Manually having to execute such things has a high probability of incorrect order or just simply forgetting to perform a specific set of operations.

Environment Considerations

Host environment considerations are needed to be taken for commonly used Drupal only hosting service provides such as Pantheon and Acquia. Unique workflows and releases need to be handled appropriately. For example, Pantheon does not allow for subdirectories containing local Git repositories (.git directories) as the top level parent is also a Git repository which indicates that the subdirectory is a submodule.

Clone this wiki locally