Changing the implementation from using shields.io to

using a local SVG file and doing replace. One less network hop.
This commit is contained in:
Zlatko Knezevic 2016-01-27 23:14:13 -08:00
parent 4f2a8aeaf9
commit ae78068481
5 changed files with 29 additions and 16 deletions

Binary file not shown.

View file

@ -0,0 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" width="102" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
<stop offset="1" stop-opacity=".1" />
</linearGradient>
<mask id="a">
<rect width="102" height="20" rx="3" fill="#fff" />
</mask>
<g mask="url(#a)">
<path fill="#555" d="M0 0h52v20H0z" />
<path fill="#007ec6" d="M52 0h50v20H52z" />
<path fill="url(#b)" d="M0 0h102v20H0z" />
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="26" y="15" fill="#010101" fill-opacity=".3">version</text>
<text x="26" y="14">version</text>
<text x="76" y="15" fill="#010101" fill-opacity=".3">ver_number</text>
<text x="76" y="14">ver_number</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

View file

@ -15,11 +15,8 @@ _ "$RepoRoot\packaging\windows\generatemsi.ps1" @("$Stage2Dir")
header "Generating NuGet packages"
_ "$RepoRoot\packaging\nuget\package.ps1" @("$Stage2Dir\bin", "$env:VersionSuffix")
header "Downloading version badge"
$VersionBadge = "$RepoRoot\artifacts\version_badge.svg"
$r = Invoke-WebRequest -Uri "https://img.shields.io/badge/version-$env:DOTNET_CLI_VERSION-blue.svg" -OutFile $VersionBadge
header "Generating version badge"
$VersionBadge = "$RepoRoot\resources\images\version_badge.svg"
(get-content $VersionBadge).replace("ver_number", "$env:DOTNET_CLI_VERSION") | set-content $VersionBadge
if ($r.StatusCode == 200)
{
& "$RepoRoot\publish\publish.ps1" "$RepoRoot\artifacts\version_badge.svg" -file $VersionBadge
}
& "$RepoRoot\publish\publish.ps1" -file $VersionBadge

View file

@ -20,7 +20,7 @@ if [ -z "$DOTNET_CLI_VERSION" ]; then
DOTNET_CLI_VERSION=0.0.1-dev-t$TIMESTAMP
fi
$VERSION_BADGE="$REPOROOT/artifacts/version_badge.svg"
$VERSION_BADGE="$REPOROOT/resources/images/version_badge.svg"
header "Generating tarball"
$DIR/package-dnvm.sh
@ -28,13 +28,9 @@ $DIR/package-dnvm.sh
header "Generating Native Installer"
$DIR/package-native.sh
header "Downloading version badge"
status_code=$(curl -w "%{http_code}" -s -o $VERSION_BADGE "https://img.shields.io/badge/version-$DOTNET_CLI_VERSION-blue.svg")
header "Generating version badge"
sed -i "s/ver_number/$DOTNET_CLI_VERSION/g" $VERSION_BADGE
if [ "$status_code" -eq "200"]; then
header "Publishing version badge"
$REPOROOT/scripts/publish/publish.sh $VERSION_BADGE
else
info "Downloading the badge failed - $status_code"
fi
header "Publishing version badge"
$REPOROOT/scripts/publish/publish.sh $VERSION_BADGE