Skip to content

Instantly share code, notes, and snippets.

@brutus
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brutus/81b251c02cf2ae7c6ceb to your computer and use it in GitHub Desktop.
Save brutus/81b251c02cf2ae7c6ceb to your computer and use it in GitHub Desktop.
Invoke YAML loading trouble
deployments:
testing:
host: xyz.domain.tld
user: username
destination: /home/username/html/misc/path/
sources:
- index.html
- img
# -*- coding: UTF-8 -*-
"""
A couple of `Invoke`_ **tasks** to…
.. _Invoke: http://www.pyinvoke.org/
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from invoke import Collection, ctask as task
from corelib.tasks.utils import make_dirs as setup, remove_dirs as clean
from corelib.tasks.web import css_ns, js_ns
from corelib.tasks.deployment import deploy_ns
@task(pre=[setup], post=[clean])
def build(ctx):
"""
Build an `index.html`.
Using the templates in ``html/`` and the data in ``data/``.
"""
print('Creating new `index.html`.')
# …
# #########################################################################
# If I comment out the stuff below, the data from `invoke.yaml` is loaded #
# #########################################################################
namespace = Collection(css_ns, js_ns, deploy_ns)
namespace.add_task(build, default=True)
namespace.configure({
'mk_dirs': ['.tmp/'],
'rm_dirs': ['.tmp/', '.sass-cache/'],
'sass_source_dir': 'html/',
'sass_destination_dir': '.tmp/',
'css_source_dir': 'html/',
'css_destination_dir': '.tmp/',
'default_deployment': 'testing'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment