forked from ymcatwincities/openy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoboFile.php
92 lines (87 loc) · 2.23 KB
/
RoboFile.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
84
85
86
87
88
89
90
91
92
<?php
/**
* Open Y Robo commands.
* Here we are able to create an any version of Open Y for CI builds.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks {
/**
* Create Open Y project https://github.com/ymcatwincities/openy-project without installation.
*
* @param string $path
* Installation path that will be used to create "openy-project" folder.
*/
function OpenyCreateProject($path) {
$this->taskComposerCreateProject()
->source('ymcatwincities/openy-project:9.2.x-init-dev')
->target($path . '/openy-project')
->ansi(TRUE)
->dev()
->noInstall(TRUE)
->noInteraction()
->run();
}
/**
* Add fork as repository to composer.json.
*
* @param string $path
* Installation path where repository should be added.
*
* @param string $repository
* Local path of the repository.
*/
function OpenyAddFork($path, $repository) {
$this->taskComposerConfig()
->dir($path . '/openy-project')
->repository(99, $repository, 'path')
->ansi(TRUE)
->run();
}
/**
* Set target branch of the fork.
*
* @param string $path
* Installation path where "openy-project" is placed.
*
* @param string $branch
* Branch name.
*/
function OpenySetBranch($path, $branch) {
$this->taskComposerRequire()
->dir($path . '/openy-project')
->dependency('ymcatwincities/openy', $branch)
->dev()
->ansi(TRUE)
->run();
}
/**
* Installs Open Y from fork as dependency.
*
* @param string $path
* Installation path where "openy-project" is placed.
*/
function OpenyInstall($path) {
$this->taskComposerInstall()
->dir($path . '/openy-project')
->noInteraction()
->dev()
->ansi(TRUE)
->run();
}
/**
* Creates symlink to mirror build folder into web accessible dir.
*
* @param string $docroot_path
* Path where website folder should be created.
*
* @param string $build_path
* Path where source code for build is placed.
*/
function OpenyBuildFolder($docroot_path, $build_path) {
$this->taskFilesystemStack()
->symlink($docroot_path, $build_path)
->chgrp('www-data', 'jenkins', TRUE)
->run();
}
}