-
Notifications
You must be signed in to change notification settings - Fork 20
/
extension.py
58 lines (45 loc) · 1.22 KB
/
extension.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
50
51
52
53
54
55
56
57
58
"""Drupal Extension
Downloads, installs and configures Drupal
"""
import os
import os.path
import logging
from build_pack_utils import utils
_log = logging.getLogger('drupal')
DEFAULTS = utils.FormattedDict({
'DRUPAL_VERSION': '7.53',
'DRUPAL_PACKAGE': 'drupal-{DRUPAL_VERSION}.tar.gz',
'DRUPAL_HASH': '4230279ecca4f0cde652a219e10327e7',
'DRUPAL_URL': 'http://ftp.drupal.org/files/projects/{DRUPAL_PACKAGE}'
})
# Extension Methods
def preprocess_commands(ctx):
return ()
def service_commands(ctx):
return {}
def service_environment(ctx):
return {}
def compile(install):
print 'Installing Drupal %s' % DEFAULTS['DRUPAL_VERSION']
ctx = install.builder._ctx
inst = install._installer
workDir = os.path.join(ctx['TMPDIR'], 'drupal')
inst.install_binary_direct(
DEFAULTS['DRUPAL_URL'],
DEFAULTS['DRUPAL_HASH'],
workDir,
fileName=DEFAULTS['DRUPAL_PACKAGE'],
strip=True)
(install.builder
.move()
.everything()
.under('{BUILD_DIR}/htdocs')
.into(workDir)
.done())
(install.builder
.move()
.everything()
.under(workDir)
.into('{BUILD_DIR}/htdocs')
.done())
return 0