-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathThemesDemo.php
83 lines (69 loc) · 2.18 KB
/
ThemesDemo.php
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
$workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow();
$deployment->setWorkflow($workflow);
$node = new \TYPO3\Surf\Domain\Model\Node('Testing');
$node->setHostname(''); // <- fill in
$node->setOption('username', ''); // <- fill in
// avoid cleaning of cache directory
$node->setOption('hardClean', FALSE);
$application = new \TYPO3\Surf\Application\TYPO3\CMS();
$application->setName('Themes.demo');
$application->setDeploymentPath(''); // <- fill in
$application->setOption('repositoryUrl', 'git://github.com/typo3-themes/Vagrant.Themes.git');
$application->setOption('keepReleases', 2);
$application->addNode($node);
$deployment->addApplication($application);
$workflow->setEnableRollback(FALSE);
$workflow->defineTask(
'themes.demo:create.symlinks',
'typo3.surf:shell',
array(
'command' => 'cp {sharedPath}/typo3_src/index.php {releasePath}/project/index.php; cp -r {sharedPath}/typo3_src/typo3 {releasePath}/project/;',
'logOutput' => TRUE
)
);
$workflow->defineTask(
'themes.demo:create.dirs',
'typo3.surf:shell',
array(
'command' => 'mkdir {releasePath}/project/typo3temp;',
'logOutput' => TRUE
)
);
$workflow->defineTask(
'themes.demo:get.extensions',
'typo3.surf:shell',
array(
'command' => 'cd {sharedPath}/typo3conf/ext/; GITTYPE=HTTP bash {releasePath}/serverdata/provision/install-extensions.sh;',
'logOutput' => TRUE
)
);
$workflow->defineTask(
'themes.demo:copy.config',
'typo3.surf:shell',
array(
'command' => 'cp -r {sharedPath}/typo3conf/* {releasePath}/project/typo3conf',
'logOutput' => TRUE
)
);
$workflow->defineTask(
'themes.demo:import.database',
'typo3.surf:shell',
array(
'command' => 'mysql --user=secretUser --password=secretPassword --host=hostname dbName < {releasePath}/serverdata/data/sql/t3-latest.sql',
'logOutput' => TRUE
) // <- fill in dbuser and password
);
$deployment->onInitialize(function() use ($workflow, $application) {
$workflow->beforeStage(
'migrate',
array(
'themes.demo:create.symlinks',
'themes.demo:create.dirs',
'themes.demo:import.database',
'themes.demo:get.extensions',
'themes.demo:copy.config',
)
);
});
?>