Skip to content

Commit

Permalink
Added support for Docker automated and build badges
Browse files Browse the repository at this point in the history
  • Loading branch information
powerman committed Apr 3, 2018
1 parent 86d25a0 commit 1438d3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/Dist/Zilla/Plugin/GitHubREADME/Badge.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ sub add_badges {
push @badges, "[![build status](https://$base_url/$user_name/$repository_name/badges/master/build.svg)]($repository/$user_name/$repository_name/commits/master)";
} elsif ($badge eq 'gitlab_cover') {
push @badges, "[![coverage report](https://$base_url/$user_name/$repository_name/badges/master/coverage.svg)]($repository/$user_name/$repository_name/commits/master)";
} elsif ($badge eq 'docker_automated') {
push @badges, "[![Docker Automated Build](https://img.shields.io/docker/automated/$user_name/$repository_name.svg)](https://github.com/$user_name/$repository_name)";
} elsif ($badge eq 'docker_build') {
push @badges, "[![Docker Build Status](https://img.shields.io/docker/build/$user_name/$repository_name.svg)](https://hub.docker.com/r/$user_name/$repository_name/)";
}
}

Expand Down Expand Up @@ -165,6 +169,8 @@ Dist::Zilla::Plugin::GitHubREADME::Badge - Dist::Zilla - add badges to github RE
badges = codecov
badges = gitlab_ci
badges = gitlab_cover
badges = docker_automated
badges = docker_build
place = bottom
phase = release
Expand Down
4 changes: 3 additions & 1 deletion t/lib/TestBadges.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ sub badge_patterns {
license => qr{//img.shields.io/cpan/l/$repo\.},
version => qr{//img.shields.io/cpan/v/$repo\.},
gitlab_ci => qr{//github.com/$ur/badges/master/build.svg},
gitlab_cover => qr{//github.com/$ur/badges/master/coverage.svg}
gitlab_cover => qr{//github.com/$ur/badges/master/coverage.svg},
docker_automated=> qr{//img.shields.io/docker/automated/$ur\.},
docker_build => qr{//img.shields.io/docker/build/$ur\.},
};
}

Expand Down

0 comments on commit 1438d3a

Please sign in to comment.