aquifer-run

0.1.0 • Public • Published

aquifer-run

After you build an aquifer project there are usually a number of commands you need to run in order to update the build against the codebase (examples: drush updb and drush fra). This extension allows you to define those commands in your aquifer.json file and run them with a single command: aquifer run.

Installation

To install aquifer-run, run the below command from within your Aquifer project:

aquifer extension-add aquifer-run

Configuration

Before using this extension, you'll need to set up your aquifer.json or aquifer.local.json file to include run profiles. See the below property definitions and example configuration.

Properties

  • defaultProfile: The run profile to use if none is specified.
  • profiles: Any number of run profiles containing the following properties:
    • ssh: Contains information for running the profile in a remote location.
      • user: The remote user.
      • host: The remote host.
      • root: The directory from which to run the profile.
    • commands: An array of commands to run as part of the parent profile. Each command is an object containing the following properties.
      • name: The command name (like "drush" or "cp").
      • args: An array of arguments to follow the command name. So for drush cc all, args would look like ["cc", "all"].

Example Configuration

This example configuration includes a "local" profile and a "remote" testing profile with ssh configuration.

{
  "aquifer-run": {
    "source": "aquifer-run",
    "defaultProfile": "local",
    "profiles": {
      "local": {
        "commands": [
          {
            "name": "drush",
            "args": ["updb"]
          },
          {
            "name": "drush",
            "args": ["cc", "all"]
          },
          {
            "name": "drush",
            "args": ["en", "master"]
          },
          {
            "name": "drush",
            "args": ["master-execute", "--scope=local", "-y"]
          },
          {
            "name": "drush",
            "args": ["fra", "-y"]
          }
        ]
      },
      "testing": {
        "ssh": {
          "user": "[REMOTE USER]",
          "host": "[REMOTE HOST]",
          "root": "[REMOTE DIRECTORY]"
        },
        "commands": [
          {
            "name": "drush",
            "args": ["updb", "-y"]
          },
          {
            "name": "drush",
            "args": ["cc", "all"]
          },
          {
            "name": "drush",
            "args": ["en", "master"]
          },
          {
            "name": "drush",
            "args": ["master-execute", "--scope=test", "-y"]
          },
          {
            "name": "drush",
            "args": ["fra", "-y"]
          }
        ]
      }
    }
  }
}

Usage

This extension adds a run command to your Aquifer project. When invoked, it will run a group of defined commands called a "profile". At least one profile must be defined in configuration before the run command will perform any actions. You can set a default profile with the defaultProfile configuration property. If no default profile is set you will need to pass the --profile or -p option to specify a profile name.

Example usage

# Run all commands in the default profile. 
aquifer run
 
# Run all commands in the "testing" profile. 
aquifer run -p testing

Dependencies (1)

Dev Dependencies (5)

Package Sidebar

Install

npm i aquifer-run

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • chasingmaxwell