Skip to content

Commit

Permalink
1.0.1.0
Browse files Browse the repository at this point in the history
new release
  • Loading branch information
stamepicmorg committed May 12, 2023
2 parents 71fcfde + 83b8cb8 commit c1d5863
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
Binary file modified docs/products.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions src/DonloaderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static char StringNext(string text, int index)
public async Task StartAsync(CancellationToken cancellationToken)
{
SetConsoleTitle();
if (options.Version)
if (options.Version || string.IsNullOrWhiteSpace(options.OutputDir))
{
ShowVersionInfo();
}
Expand All @@ -119,7 +119,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
{
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)
{
Expand Down Expand Up @@ -182,7 +182,7 @@ private void ShowVersionInfo()
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];
Expand All @@ -192,7 +192,10 @@ private void ShowVersionInfo()
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);
}
Expand All @@ -211,6 +214,7 @@ private string[] GetFeedUrls() => options.CustomFeed != null
"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",
Expand All @@ -222,12 +226,14 @@ private string[] GetFeedUrls() => options.CustomFeed != null
"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",
Expand Down
2 changes: 1 addition & 1 deletion src/Models/DownloaderOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
}
9 changes: 6 additions & 3 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Serilog;

using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;

namespace EpicMorg.Atlassian.Downloader
Expand All @@ -19,13 +21,14 @@ public class Program
/// <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())
Expand All @@ -41,7 +44,7 @@ static async Task Main(string OutputDir = "atlassian", Uri[] customFeed = null,
.AddSerilog(dispose: true);
})
.AddHostedService<DonloaderService>()
.AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action, Version))
.AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action, Version, productVersion))
.AddHttpClient())
.RunConsoleAsync()
.ConfigureAwait(false);
Expand Down
6 changes: 3 additions & 3 deletions src/atlassian-downloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit c1d5863

Please sign in to comment.