forked from beetboxvm/beetbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoboFile.php
46 lines (41 loc) · 1.17 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
<?php
/**
* Console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
/**
* Provision beetbox container.
*
* @param string $image Base docker image
* @param string $name Container/Image name
* @return \Robo\Result
*/
public function provision($image = 'ubuntu:14.04', $name = 'beet_test')
{
// Create build container.
$build = $this->taskDockerRun($image)
->name($name)
->env('INSTALL_PACKER', 'true')
->exec('/beetbox/provisioning/beetbox.sh')
->volume(__DIR__ . '/', '/beetbox/')
->volume(__DIR__, '/var/beetbox')
->interactive()
->run();
if ($build->wasSuccessful()) {
// Commit build container to an image.
$this->taskDockerCommit($build['cid'])
->name($name)
->run();
// Remove build container.
$this->taskDockerRemove($name)
->printed(FALSE)
->option('force')
->option('volumes')
->run();
}
return $build;
}
}