__init__.py 1.68 KB
Newer Older
Emmanuel Milou's avatar
Emmanuel Milou committed
1
2
import docker
from deploy  import *
3
import drush
4
import behat
5
6
from .environments import e

7
from fabric.api import task, env, execute
8
9
10
11
12
13
14
15
16
17
18
19

import helpers as h

@task
def init():
    """
    Complete local installation process, used generally when building the docker image for install and configure Drupal.
    """

    execute(docker.image_create)
    execute(docker.container_start)
    execute(drush.make, 'install')
20
    execute(drush.site_install, host='root@{}'.format(env.container_ip))
21
    execute(drush.aliases)
22
    execute(behat.init, host='root@{}'.format(env.container_ip))
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49



@task
def test():
    """
    Setup Behat and run the complete tests suite. Default output formatters: pretty and JUnit.
    The JUnit report file is specified in the Behat configuration file. Default: tests/behat/out/behat.junit.xml.

    :param tag Specific Behat tests tags to run.

    """
    execute(behat.init)
    execute(behat.run)



@task
def install():

    """
    Run the full installation process.
    """

    execute(drush.make, 'install')
    execute(drush.site_install)
    execute(behat.init)
50

51
52
53
54
55
56
57
58
59
60
61
62


@task
def update():

    """
    Update the full codebase and run the availabe database updates.
    """

    execute(drush.make, 'update')
    execute(drush.updatedb)
    execute(behat.init)
63

64
65
66
67
68
69
70

@task
def release():

    """
    Generate all artefacts related to a release process or a deployment process.
    """
71

72
    execute(drush.archive_dump)
73
    execute(drush.gen_doc)
Emmanuel Milou's avatar
Emmanuel Milou committed
74
75
76
77
78
79
80
81


@task
def deploy(environment):
    """Deploy code and run database updates on a target Drupal environment.
    """

    execute(provision, environment)
82
83
    execute(push, environment, hosts=env.hosts)
    execute(migrate, environment, hosts=env.hosts)