System commands

system.command

{
  "list-source": {
    "sequence": 1,
    "command": "system.command",
    "params": {
      "command": "ls -las /home",
      ("secure":"False")
    }
  }
}

Functionality:

  • Run command on server
  • If secure param is set to true, then it won’t output the command with params. Default value is False

system.multi_command

{
  "list-source": {
    "sequence": 1,
    "command": "system.multi_command",
        "params": {
    "command":"print %(domain)s",
    "list_config_file": "config/%(project)s/list/%(environment)s.json",
    ("secure":"False")
}
  }
}

Functionality:

  • Run command on server and use a source json file to format params.
  • It will format the command based on the list_config_file
  • The list_config_file wil overwrite any previous set params
  • If secure param is set to true, then it won’t output the command with params. Default value is False

Example list

[
  {
    "domain": "domain1.com"
  },
  {
    "domain": "domain2.com"
  }
]

system.multi_local_command

{
  "your-own-description": {
    "sequence": 1,
    "command": "system.multi_local_command",
    "params": {
    "command":"print %(domain)s",
    "list_config_file": "config/%(project)s/list/%(environment)s.json",
    ("secure":"False")
    }
  }
}

Functionality: (see multi_command)

  • Run command on local server and use a source json file to format params.
  • It will format the command based on the list_config_file
  • The list_config_file wil overwrite any previous set params
  • If secure param is set to true, then it won’t output the command with params. Default value is False

system.upload_template

{
  "upload-environment-config": {
    "sequence": 1,
    "command": "system.upload_template",
    "params": {
      "source": "some/file/in/the/template/path.ini",
      "target": "/path/where/to/copy/on/the/server.ini",
      "yourvar_1": "whatever",
      "yourvar_2": "you-want"
    }
  }
}

Functionality:

  • Uploads template from .template folder/file to server.
  • Renders the template with params.. you can use {{ param_name }} in the template. In this example the path.ini could contain the param {{ yourvar_1 }}.
  • Unlimited own params.. source and target are required

system.ensure_path

{
  "your-own-description": {
    "sequence": 1,
    "command": "system.ensure_path",
    "params": {
      "path": "/the/full/path/you/need"
    }
  }
}

Functionality:

  • Checks if folders exists, if not it will try to create the path

system.download_from_remote

{
  "your-own-description": {
    "sequence": 1,
    "command": "system.download_from_remote",
    "params": {
      "remote_path": "/some/remote/path/*.jpg",
      "local_path": "./templates/tmp"
    }
  }
}

Functionality:

  • Will download file(s)
  • Can use wildcards for files.
  • Can download one or more files/folders

system.upload_to_remote

{
  "your-own-description": {
    "sequence": 1,
    "command": "system.upload_to_remote",
    "params": {
      "local_source": "/some/remote/path/*.jpg",
      "target_source": "./templates/tmp"
    }
  }
}

Functionality:

  • Will upload file(s)
  • Can use wildcards for files.
  • Can upload one or more files/folders

system.filesystem_remove_old

{
  "delete-old-files": {
    "sequence": 1,
    "command": "system.cleanup_old_files",
    "params": {
      "minutes": "86400",
      "path": "/some/path"
    }
  }
}

Params: - minutes : Remove files older then x minutes (optional, default 86400) - path : path to folder.(required)

Functionality:

  • Deletes old files and (sub)folders