forked from codeceptjs/CodeceptJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoboFile.php
98 lines (89 loc) · 2.6 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
93
94
95
96
97
98
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
function docs()
{
$this->taskGulpRun('docs')
->run();
$this->taskGitStack()
->add('docs')
->commit('updated docs')
->run();
}
function publishSite()
{
$this->stopOnFail();
$this->_copy('CHANGELOG.md', 'docs/changelog.md');
$this->_copy('docker/README.md', 'docs/docker.md');
$this->wiki();
$this->taskExec('npm install')
->dir('website')
->run();
$this
->taskExec('USE_SSH=true GIT_USER=davertmik npm run publish-gh-pages')
->dir('website')
->run();
}
/**
* Synchronizes CodeceptJS wiki pages with docs
*/
function wiki()
{
if (!file_exists('website/wiki/Home.md')) {
$this->taskGitStack()
->cloneShallow('git@github.com:Codeception/CodeceptJS.wiki.git', 'website/wiki')
->run();
}
$this->taskGitStack()
->dir('website/wiki')
->pull()
->run();
$this->taskWriteToFile('docs/community-helpers.md')
->line('---')
->line('id: community-helpers')
->line('title: Community Helpers')
->line('---')
->line('')
->line('> Share your helpers at our [Wiki Page](https://github.com/Codeception/CodeceptJS/wiki/Community-Helpers)')
->line('')
->textFromFile('website/wiki/Community-Helpers.md')
->run();
$this->taskWriteToFile('docs/examples.md')
->line('---')
->line('id: examples')
->line('title: Examples')
->line('---')
->line('')
->line('> Add your own examples to our [Wiki Page](https://github.com/Codeception/CodeceptJS/wiki/Examples)')
->textFromFile('website/wiki/Examples.md')
->run();
}
function testServer()
{
$this->taskExec('npm run json-server')
->background()
->run();
$this->taskServer(8000)
->dir('test/data/app')
->run();
}
function release()
{
$package = json_decode(file_get_contents('package.json'), true);
$version = $package['version'];
$this->docs();
$this->stopOnFail();
$this->publishSite();
$this->taskGitStack()
->tag($version)
->push('origin master --tags')
->run();
$this->_exec('npm publish');
$this->yell('It is released!');
}
}