Last active
August 29, 2015 14:20
-
-
Save brutus/81b251c02cf2ae7c6ceb to your computer and use it in GitHub Desktop.
Invoke YAML loading trouble
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployments: | |
testing: | |
host: xyz.domain.tld | |
user: username | |
destination: /home/username/html/misc/path/ | |
sources: | |
- index.html | |
- img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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