###############################################################################
# Propel Toucan
#
# A deploy config file to deploy Toucan app on the server
#
# https://github.com/mardix/propel
#
# - run: 'propel -w' on the hosting server to launch a web application
# - run: 'propel -k' on the hosting server to launch a worker application
# - run: 'propel -s $script-name' on the hosting server to execute a
#                                 script by name
#
###############################################################################


# Virtualenv
virtualenv:
  name: ""  # The name of the virtualenv. Required for python applications

# WEB: list of dict of web sites/application to deploy
web:
  -
    name: "" # The site name
    application: "app_{project_name}:app"
    environment: ENV="Production"

    # Nginx related config
    nginx:
      aliases:
        "/static": "application/{project_name}/static"
        "/files": "application/data/uploads"

# SCRIPTS: A dict of all scripts to execute
scripts:

  # Run before all
  before_all:
    -
      command: "$PYTHON_ENV manage.py setup"
      environment: ENV="Production"

  # Run after all
  after_all:
    - command: ""

  # run before web deployment
  before_web:
    - command: ""

  # run after web deployment
  after_web:
    - command: ""

  # run before web deployment
  before_workers:
    - command: ""

  # run after web deployment
  after_workers:
    - command: ""

  # run this script when UNDEPLOYING
  undeploy:
    - command: ""

# WORKERS: Run custom script or app in the background using supervisor
workers:
  -
    name: "myworker1"
    command: ""
    environment: ENV="Production"


# ------------------------------------------------------------------------------
# Git Push
# If GIT is available in your environment, you can quickly push directly
# to your remotes.
# git-remotes: dict of remote name and git repos
# To deploy on the 'web' remote:
# > toucan push -r web
#
git-remotes:
  web:
    - ssh://user@host/path.git


