-
Notifications
You must be signed in to change notification settings - Fork 0
/
rancheros-stats.ps1
29 lines (25 loc) · 1.31 KB
/
rancheros-stats.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$releases = Invoke-RestMethod https://api.github.com/repos/rancher/os/releases
$githubStats = @()
forEach($v in $releases) {
$iso = $v.assets | Where-Object {$_.name -eq "rancheros.iso"}
$rootfs = $v.assets | Where-Object {$_.name -eq "rootfs.tar.gz"}
$githubStats += New-Object -TypeName PSObject -Property @{
name = $v.name
releaseDate = $v.published_at.ToString("yyyy-MM-dd")
isoDownloads = $iso.download_count
pxeDownloads = $rootfs.download_count
}
}
$githubStats | Sort-Object releaseDate | Select-Object name,releaseDate,isoDownloads,pxeDownloads | Export-Csv RancherOS_GitHubStats.csv -NoType
$osStats = Invoke-RestMethod https://hub.docker.com/v2/repositories/rancher/os/
$osStats | Select-Object last_updated,pull_count | Export-Csv RancherOS_DockerHubTotalPull.csv -NoType
$dockerHubStats = @()
$osTagStats = Invoke-RestMethod "https://hub.docker.com/v2/repositories/rancher/os/tags?page_size=100&page=1&ordering=last_updated"
forEach($osTag in $osTagStats.results) {
$dockerHubStats += New-Object -TypeName PSObject -Property @{
name = $osTag.name
releaseDate = $osTag.tag_last_pushed.ToString("yyyy-MM-dd")
lastPull = $osTag.tag_last_pulled.ToString("yyyy-MM-dd")
}
}
$dockerHubStats | Sort-Object releaseDate | Select-Object name,releaseDate,lastPull | Export-Csv RancherOS_DockerHubStats.csv -NoType