Completed
Push — master ( 95a54c...7178fa )
by Samuel
10:58
created

DockerCompose::getVersionCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Dock\Installer\System\Linux;
4
5
use Dock\Installer\SoftwareInstallTask;
6
7
class DockerCompose extends SoftwareInstallTask
8
{
9
    const VERSION = '1.3.1';
10
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getName()
15
    {
16
        return 'dockerCompose';
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function getVersionCommand()
23
    {
24
        return 'docker-compose --version';
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function getInstallCommand()
31
    {
32
        $file = 'https://github.com/docker/compose/releases/download/'.self::VERSION.'/docker-compose-'.php_uname('s').'-'.php_uname('m');
33
34
        return "curl -L $file > /tmp/docker-compose && chmod +x /tmp/docker-compose && sudo mv /tmp/docker-compose /usr/local/bin/docker-compose";
35
    }
36
}
37