new release
This commit is contained in:
STAM 2023-05-12 13:17:02 +03:00
parent 71fcfde668
commit 83b8cb81c1
Signed by: stam
GPG Key ID: 4F57E51F9C45F8CD
7 changed files with 23 additions and 12 deletions

View File

@ -1,6 +1,7 @@
# Atlassian Downloader - Changelog
* `1.0.0.9` - switched to `dontet7.0`, updated deps.
* `1.0.1.0` - added support of `Atlassian Bitbucket (Mesh)` product, updated deps, fixed `Chocolatey` support and start logic.
* `1.0.0.9` - updated deps.
* `1.0.0.8` - switched to `dontet6.0`, updated deps.
* `1.0.0.7` - added `unofficial support` of `sourcetree` via automatic mirror [from github](https://github.com/EpicMorg/atlassian-json). fixed `logger` output, code improvments.
* `1.0.0.6` - added support of `clover`. fixed broken json parsing. added new `logger`.

View File

@ -111,6 +111,7 @@ The following built-in themes are available, provided by `Serilog.Sinks.Console`
|-------------|:-------------:|:-------------:|:-------------:|
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Bamboo&color=bright%20green&style=for-the-badge)](https://www.atlassian.com/software/bamboo) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Bitbucket%20(Stash)&color=bright%20green&style=for-the-badge)](https://www.atlassian.com/software/bitbucket) | :white_check_mark: | :white_check_mark: | :interrobang: |
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Bitbucket%20(Mesh)&color=bright%20green&style=for-the-badge)](https://confluence.atlassian.com/bitbucketserver/bitbucket-mesh-compatibility-matrix-1127254859.html) | :white_check_mark: | :white_check_mark: | :interrobang: |
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Clover&color=bright%20green&style=for-the-badge)](https://www.atlassian.com/software/clover) | :white_check_mark: | :white_check_mark: | :x: |
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Confluence&color=bright%20green&style=for-the-badge)](https://www.atlassian.com/software/confluence) | :white_check_mark: | :white_check_mark: | :x: |
| [![Product](https://img.shields.io/static/v1?label=Atlassian&message=Crowd&color=bright%20green&style=for-the-badge)](https://www.atlassian.com/software/crowd) | :white_check_mark: | :white_check_mark: | :x: |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -103,7 +103,7 @@ namespace EpicMorg.Atlassian.Downloader
public async Task StartAsync(CancellationToken cancellationToken)
{
SetConsoleTitle();
if (options.Version)
if (options.Version || string.IsNullOrWhiteSpace(options.OutputDir))
{
ShowVersionInfo();
}
@ -119,7 +119,7 @@ namespace EpicMorg.Atlassian.Downloader
{
return;
}
var (json, versions) = await this.GetJson(feedUrl, cancellationToken).ConfigureAwait(false);
var (json, versions) = await this.GetJson(feedUrl, options.ProductVersion, cancellationToken).ConfigureAwait(false);
switch (options.Action)
{
@ -182,7 +182,7 @@ namespace EpicMorg.Atlassian.Downloader
Console.ResetColor();
}
private async Task<(string json, IDictionary<string, ResponseItem[]> versions)> GetJson(string feedUrl, CancellationToken cancellationToken)
private async Task<(string json, IDictionary<string, ResponseItem[]> versions)> GetJson(string feedUrl, string? productVersion = null, CancellationToken cancellationToken = default)
{
var atlassianJson = await client.GetStringAsync(feedUrl, cancellationToken).ConfigureAwait(false);
var json = atlassianJson.Trim()["downloads(".Length..^1];
@ -192,7 +192,10 @@ namespace EpicMorg.Atlassian.Downloader
PropertyNameCaseInsensitive = true
});
logger.LogDebug("Found {0} releases", parsed.Length);
var versions = parsed.GroupBy(a => a.Version).ToDictionary(a => a.Key, a => a.ToArray());
var versions = parsed
.GroupBy(a => a.Version)
.Where(a => productVersion is null || a.Key == productVersion)
.ToDictionary(a => a.Key, a => a.ToArray());
logger.LogDebug("Found {0} releases", versions.Count);
return (json, versions);
}
@ -211,6 +214,7 @@ namespace EpicMorg.Atlassian.Downloader
"https://my.atlassian.com/download/feeds/archived/jira-software.json",
"https://my.atlassian.com/download/feeds/archived/jira.json",
"https://my.atlassian.com/download/feeds/archived/stash.json",
"https://my.atlassian.com/download/feeds/archived/mesh.json",
"https://my.atlassian.com/download/feeds/current/bamboo.json",
"https://my.atlassian.com/download/feeds/current/clover.json",
@ -222,12 +226,14 @@ namespace EpicMorg.Atlassian.Downloader
"https://my.atlassian.com/download/feeds/current/jira-servicedesk.json",
"https://my.atlassian.com/download/feeds/current/jira-software.json",
"https://my.atlassian.com/download/feeds/current/stash.json",
"https://my.atlassian.com/download/feeds/current/mesh.json",
"https://my.atlassian.com/download/feeds/eap/bamboo.json",
"https://my.atlassian.com/download/feeds/eap/confluence.json",
"https://my.atlassian.com/download/feeds/eap/jira.json",
"https://my.atlassian.com/download/feeds/eap/jira-servicedesk.json",
"https://my.atlassian.com/download/feeds/eap/stash.json",
"https://my.atlassian.com/download/feeds/eap/mesh.json",
//https://raw.githubusercontent.com/EpicMorg/atlassian-json/master/json-backups/archived/sourcetree.json
"https://raw.githack.com/EpicMorg/atlassian-json/master/json-backups/archived/sourcetree.json",

View File

@ -2,5 +2,5 @@
namespace EpicMorg.Atlassian.Downloader
{
public record DownloaderOptions(string OutputDir, Uri[] CustomFeed, DownloadAction Action,bool Version) { }
public record DownloaderOptions(string OutputDir, Uri[] CustomFeed, DownloadAction Action,bool Version, string ProductVersion) { }
}

View File

@ -6,6 +6,8 @@ using Microsoft.Extensions.Logging;
using Serilog;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace EpicMorg.Atlassian.Downloader
@ -19,13 +21,14 @@ namespace EpicMorg.Atlassian.Downloader
/// <param name="OutputDir">Override output directory to download</param>
/// <param name="customFeed">Override URIs to import</param>
/// <param name="Version">Show credits banner</param>
static async Task Main(string OutputDir = "atlassian", Uri[] customFeed = null, DownloadAction Action = DownloadAction.Download, bool Version = false) => await
/// <param name="productVersion">Override target version to download some product. Advice: Use it with "customFeed".</param>
static async Task Main(string OutputDir, Uri[] customFeed = null, DownloadAction Action = DownloadAction.Download, bool Version = false, string productVersion = null) => await
Host
.CreateDefaultBuilder()
.ConfigureHostConfiguration(configHost => configHost.AddEnvironmentVariables())
.ConfigureAppConfiguration((ctx, configuration) =>
configuration
.SetBasePath(Environment.CurrentDirectory)
.SetBasePath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{ctx.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables())
@ -41,7 +44,7 @@ namespace EpicMorg.Atlassian.Downloader
.AddSerilog(dispose: true);
})
.AddHostedService<DonloaderService>()
.AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action, Version))
.AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action, Version, productVersion))
.AddHttpClient())
.RunConsoleAsync()
.ConfigureAwait(false);

View File

@ -17,9 +17,9 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/EpicMorg/atlassian-downloader</RepositoryUrl>
<PackageTags>atlassian, donwloader, epicmorg</PackageTags>
<AssemblyVersion>1.0.0.9</AssemblyVersion>
<FileVersion>1.0.0.9</FileVersion>
<Version>1.0.0.9</Version>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<Version>1.0.1.0</Version>
<Copyright>EpicMorg 2023</Copyright>
<Product>Atlassian Downloader</Product>
<IsPackable>true</IsPackable>