forked from Kunstmaan/skylab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-doc
More file actions
executable file
·154 lines (112 loc) · 5.07 KB
/
gen-doc
File metadata and controls
executable file
·154 lines (112 loc) · 5.07 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env php
<?php
require_once __DIR__.'/vendor/autoload.php';
?>
# Skylab
Skylab is a 100% backwards compatible PHP port of the Python based hosting scripts used at Kunstmaan. By using the Cilex,
Symfony Components and lots of good code samples from the Composer project we hope to create an application that
everyone in our organisation can work with, and if issues or new needed features should arise, be able to work on.
Kunstmaan wouldn't be Kunstmaan if we didn't open-source this, so here it is. [MIT licensed](./LICENSE).
## Installation
To install Skylab, run this command:
```
$ curl -sSL https://raw.github.com/Kunstmaan/skylab/master/installer | php
```
This will just check a few PHP settings and then download skylab.phar to your working directory. This file is the Skylab
binary. It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst
other things.
You can install Skylab to a specific directory by using the --install-dir option and providing a target directory (it
can be an absolute or relative path):
```
$ curl -sSL https://raw.github.com/Kunstmaan/skylab/master/installer | php -- --install-dir=/bin
```
You can also install Skylab globally by running:
```
$ curl -sSL https://raw.github.com/Kunstmaan/skylab/master/installer | php
$ mv skylab.phar /usr/local/bin/skylab
```
## Configuration
You can override the [default configuration](./config.yml) by creating a file /etc/skylab.yml and give it a secure chmod
```
sudo chmod 700 /etc/skylab.yml
```
For example if you installed skylab on a developer OSX machine:
```
users:
wwwuser: apache
webserver:
engine: apache
hostmachine: XXXXX.kunstmaan.be
mysql:
user: root
password: XXXXXXXXX
postgresql:
user: postgres
password: XXXXXXXXX
debug: true
develmode: true
```
Or on an ubuntu system:
```
users:
wwwuser: www-data
webserver:
engine: apache
hostmachine: XXXXX.kunstmaan.be
mysql:
user: root
password: XXXXXXXXX
postgresql:
user: postgres
password: XXXXXXXXX
debug: true
develmode: true
```
## Commands
<?php
describeCommand(new \Kunstmaan\Skylab\Command\NewProjectCommand());
describeCommand(new \Kunstmaan\Skylab\Command\FetchCommand());
describeCommand(new \Kunstmaan\Skylab\Command\ShareCommand());
describeCommand(new \Kunstmaan\Skylab\Command\SetPermissionsCommand());
describeCommand(new \Kunstmaan\Skylab\Command\MaintenanceCommand());
describeCommand(new \Kunstmaan\Skylab\Command\BackupCommand());
describeCommand(new \Kunstmaan\Skylab\Command\RemoveProjectCommand());
describeCommand(new \Kunstmaan\Skylab\Command\ApplySkeletonCommand());
describeCommand(new \Kunstmaan\Skylab\Command\SelfUpdateCommand());
function describeCommand(\Kunstmaan\Skylab\Command\AbstractCommand $command){
echo "### " . get_class_name($command) . "\n\n";
echo "Usage: ```php skylab.phar " . $command->getSynopsis() . "```\n\n";
echo str_replace("</info>", "```", str_replace("<info>", "```", $command->getProcessedHelp())) . "\n";
echo "Full details at [doc/".get_class_name($command).".md](doc/".get_class_name($command).".md)\n\n";
system("mkdir -p doc");
system("SU=true ./skylab help " . $command->getName() . " --format=md > doc/".get_class_name($command).".md");
system('printf "\n\n" >> doc/' .get_class_name($command).".md");
system("echo '*Documentation generated on " . date_format(new DateTime(), "Y-m-d H:i:s") . "*' >> doc/".get_class_name($command).".md");
}
function get_class_name($object = null)
{
if (!is_object($object) && !is_string($object)) {
return false;
}
$class = explode('\\', (is_string($object) ? $object : get_class($object)));
return $class[count($class) - 1];
}
?>
## Compiling a new version
1. First, make sure everything works and the Travis tests are green [](https://travis-ci.org/Kunstmaan/skylab)
1. Generate an updated changelog using ```git changelog``` from [git-extras](https://github.com/visionmedia/git-extras)
1. Commit this new changelog
1. Create a new release from the Github interface, add the new changelog part in the description and name the release for [the next brightst star in this list](http://en.wikipedia.org/wiki/List_of_brightest_stars)
1. Compile a new version ```./compile --version 0.1.2```
1. Add the new phar file to the release on GitHub
## Modifying the documentation
1. Most text is in ```gen-doc```, edit what you want there.
1. Everything in doc/ is generated, same goes for everything in README.md under Commands
1. Run ```./gen-doc > README.md``` to update the docs
1. Send a pull request
## Contributing
1. Fork Skylab
1. Do your thing, and send a Pull Request. But please make sure Travis is green and your code has been run through php-cs-fixer!
[](https://scrutinizer-ci.com/g/Kunstmaan/skylab/)
<?php
echo "*Documentation generated on " . date_format(new DateTime(), "Y-m-d H:i:s") . "*";