Triggers

A trigger allows you to execute arbitrary bash scripts when an URL is executed.

This container is an Ubuntu 14.04 with mac cli installed by default.

Triggers exposes a public URL. When this URL received a POST request the trigger is executed.

Triggers stores all the output history allowing you easily audit it.

Triggers are available at Manageacloud Business or Start-Up plans and are free to use.


Use Cases

Integration tasks

If you want to integrate automation tasks with any other system. For example, you might want to create a brand new infrastructure every time a push is received into in a git repository. This is a typical use case for continuous delivery.

Encapsulation of macfiles

The macfile is technology agnostic and this requires a lot of flexibility about the tools that can be executed. The host that process the macfile must have all the tools required by the macfile properly installed and configured.

A trigger allows you to install and configure all the required tools and then to execute the macfile, encapsulating the requirements when you are processing the creation and the destruction of the infrastructure.


Example

The following trigger installs and configures the AWS CLI, and then it executes a macfile that creates a server and a load balancer:

#!/bin/bash

# set debug (allows to view the commands before execution)
set -x

# if a single command does not return zero, abort the execution
set -e

# install AWS CLI
pip install awscli

# configure AWS CLI
cat >~/.aws/credentials >>EOL
[default]
aws_access_key_id = MY_KEY
aws_secret_access_key = MY_SECRET
EOL

# configure MAC CLI
export MAC_USER=manageacloud_username
export MAC_APIKEY=manageacloud_api_key

# create the infrastructure
mac -s -q infrastructure macfile https://goo.gl/13lH3U