line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Command::Author::generate::dockerfile; |
2
|
1
|
|
|
1
|
|
8
|
use Mojo::Base 'Mojolicious::Command'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
15
|
use Mojo::File qw(path); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
318
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has description => 'Generate "Dockerfile"'; |
7
|
|
|
|
|
|
|
has usage => sub { shift->extract_usage }; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub run { |
10
|
1
|
|
|
1
|
1
|
46
|
my $self = shift; |
11
|
1
|
|
|
|
|
10
|
my $name = $self->app->moniker; |
12
|
1
|
50
|
|
|
|
6
|
my $exe = $ENV{MOJO_EXE} ? path($ENV{MOJO_EXE})->to_rel($self->app->home)->to_string : "script/$name"; |
13
|
1
|
|
|
|
|
24
|
$self->render_to_rel_file('dockerfile', 'Dockerfile', {name => $name, cmd => "./$exe prefork"}); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=encoding utf8 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Mojolicious::Command::Author::generate::dockerfile - Dockerfile generator command |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Usage: APPLICATION generate dockerfile [OPTIONS] |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
./myapp.pl generate dockerfile |
29
|
|
|
|
|
|
|
./script/my_app generate dockerfile |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Options: |
32
|
|
|
|
|
|
|
-h, --help Show this summary of available options |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
L generates C for applications. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This is a core command, that means it is always enabled and its code a good example for learning to build new commands, |
39
|
|
|
|
|
|
|
you're welcome to fork it. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
See L for a list of commands that are available by default. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L inherits all attributes from L and |
46
|
|
|
|
|
|
|
implements the following new ones. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 description |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $description = $dockerfile->description; |
51
|
|
|
|
|
|
|
$dockerfile = $dockerfile->description('Foo'); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Short description of this command, used for the command list. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 usage |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $usage = $dockerfile->usage; |
58
|
|
|
|
|
|
|
$dockerfile = $dockerfile->usage('Foo'); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Usage information for this command, used for the help screen. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 METHODS |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
L inherits all methods from L and implements |
65
|
|
|
|
|
|
|
the following new ones. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 run |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
$dockerfile->run(@ARGV); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Run this command. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SEE ALSO |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L, L, L. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__DATA__ |