App-JenkinsCli
view release on metacpan or search on metacpan
262728293031323334353637383940414243444546=head1 SYNOPSIS
jenkins-cli [option] command
OPTIONS:
-b --base-url[=]str
The base url of the Jenkins instance to talk to
-U --username[=]str
The username to interact with Jenkins
-P --password[=]str
The passowrd of --username
-v --verbose Show more detailed option
--version Prints the version information
--help Prints this help information
--man Prints the full documentation for jenkins-cli
COMMANDS:
ls|list [search]
List jenkins jobs
5859606162636465666768697071727374757677=head1 CONFIGURATION
You can save your configuration into C<~/.jenkins-cli.yml> so that you don't
have to enter them each time. The following is an example of what the file
looks like:
---
base_url: http://localhost:8080/
username: admin
password: my-secrent-password
=head1 SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.
perldoc App::JenkinsCli
You can also look for information at:
bin/jenkins-cli view on Meta::CPAN
90919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
my
(
$option
,
$auto
,
$errors
) =
@_
;
my
$sub_command
=
$option
->cmd;
if
(
$sub_command
eq
'--'
) {
warn
'--'
;
}
},
},
[
'base_url|base-url|b=s'
,
'username|U=s'
,
'password|P=s'
,
'colors|c=s%'
,
'color!'
,
'test|T!'
,
'verbose|v+'
,
],
);
# do stuff here
my
$jenkins
= App::JenkinsCli->new(
base_url
=>
$options
->base_url || _error(
'Missing base_url!'
),
api_key
=>
$options
->username || _error(
'Missing username!'
),
api_pass
=>
$options
->password || _error(
'Missing password!'
),
test
=>
$options
->test,
colours
=>
$options
->colors,
opt
=>
$options
,
);
return
$jenkins
->
$cmd
(@{
$opt
->files }) || 0;
}
sub
_error {
my
(
$msg
) =
@_
;
bin/jenkins-cli view on Meta::CPAN
137138139140141142143144145146147148149150151152153154155156157=head1 SYNOPSIS
jenkins-cli [option] command
OPTIONS:
-b --base-url[=]str
The base url of the Jenkins instance to talk to
-U --username[=]str
The username to interact with Jenkins
-P --password[=]str
The passowrd of --username
-v --verbose Show more detailed option
--version Prints the version information
--help Prints this help information
--man Prints the full documentation for jenkins-cli
COMMANDS:
ls|list [search]
List jenkins jobs
bin/jenkins-cli view on Meta::CPAN
179180181182183184185186187188189190191192193194195196197198199=head1 CONFIGURATION AND ENVIRONMENT
You can save your configuration into C<~/.jenkins-cli.yml> so that you don't
have to enter them each time. The following is an example of what the file
looks like:
---
base_url: http://localhost:8080/
username: admin
password: my-secrent-password
=head1 DEPENDENCIES
=head1 INCOMPATIBILITIES
=head1 BUGS AND LIMITATIONS
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
example/rebuild-to-success view on Meta::CPAN
3132333435363738394041424344454647484950515253545556575859606162
name
=>
'jenkins-cli'
,
conf_prefix
=>
'.'
,
helper
=> 1,
default
=> {
sleep
=> 10,
},
},
[
'base_url|base-url|b=s'
,
'username|U=s'
,
'password|P=s'
,
'start'
,
'sleep|s=i'
,
'verbose|v+'
,
],
);
# do stuff here
my
$jenkins
= Jenkins::API->new({
base_url
=>
$options
->base_url,
api_key
=>
$options
->username,
api_pass
=>
$options
->password,
});
my
$job
=
shift
@ARGV
||
die
"No job supplied!\n"
;
my
(
$result
,
$build
) = status(
$jenkins
,
$job
);
my
$number
=
$result
->{nextBuildNumber} - 1;
while
(
$build
->{building} ||
$build
->{result} ne
'SUCCESS'
) {
if
( !
$build
->{building} &&
$build
->{number} ==
$number
) {
warn
"$job : Retrying\n"
;
lib/App/JenkinsCli.pm view on Meta::CPAN
541542543544545546547548549550551552553554555556557558559560561=item base_url
The base URL of Jenkins
=item api_key
The username to access jenkins by
=item api_pass
The password to access jenkins by
=item test
Flag to not actually perform changes
=item jenkins
Internal L<Jenkins::API> object
=item colours
( run in 3.159 seconds using v1.01-cache-2.11-cpan-9b1e4054eb1 )