-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from datalust/dev
5.1 Maintenance Release
- Loading branch information
Showing
16 changed files
with
299 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string] $version | ||
) | ||
|
||
$versionParts = $version.Split('.') | ||
|
||
$major = $versionParts[0] | ||
$minor = $versionParts[1] | ||
|
||
$baseImage = "datalust/seqcli-ci:$version" | ||
$publishImages = "datalust/seqcli:latest", "datalust/seqcli:$major", "datalust/seqcli:$major.$minor", "datalust/seqcli:$version" | ||
|
||
$choices = "&Yes", "&No" | ||
$decision = $Host.UI.PromptForChoice("Publishing ($baseImage) as ($publishImages)", "Does this look right?", $choices, 1) | ||
if ($decision -eq 0) { | ||
foreach ($publishImage in $publishImages) { | ||
Write-Host "Publishing $publishImage" | ||
|
||
docker tag $baseImage $publishImage | ||
if ($LASTEXITCODE) { exit 1 } | ||
|
||
docker push $publishImage | ||
if ($LASTEXITCODE) { exit 1 } | ||
} | ||
} else { | ||
Write-Host "Cancelled" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=apikey/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Camelize/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cmds/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=command_0027s/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Datalust/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=hackily/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=mdash/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=seqcli/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Serilog/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=serilogdt/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=STDIN/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=syslogdt/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=trailingindent/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=trailingindent/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=unawaited/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using SeqCli.Config; | ||
using SeqCli.Util; | ||
using Serilog; | ||
|
||
namespace SeqCli.Cli.Commands.Profile | ||
{ | ||
[Command("profile", "create", "Create or replace a connection profile", | ||
Example = "seqcli profile create -n Production -s https://seq.example.com -a th15ISanAPIk3y")] | ||
class CreateCommand : Command | ||
{ | ||
string _url, _apiKey, _name; | ||
|
||
public CreateCommand() | ||
{ | ||
Options.Add("n=|name=", | ||
"The name of the connection profile", | ||
v => _name = ArgumentString.Normalize(v)); | ||
|
||
Options.Add("s=|server=", | ||
"The URL of the Seq server", | ||
v => _url = ArgumentString.Normalize(v)); | ||
|
||
Options.Add("a=|apikey=", | ||
"The API key to use when connecting to the server, if required", | ||
v => _apiKey = ArgumentString.Normalize(v)); | ||
} | ||
|
||
protected override Task<int> Run() | ||
{ | ||
return Task.FromResult(RunSync()); | ||
} | ||
|
||
int RunSync() | ||
{ | ||
if (_name == null) | ||
{ | ||
Log.Error("A profile name is required"); | ||
return 1; | ||
} | ||
|
||
if (_url == null) | ||
{ | ||
Log.Error("A server URL is required"); | ||
return 1; | ||
} | ||
|
||
try | ||
{ | ||
var config = SeqCliConfig.Read(); | ||
config.Profiles[_name] = new SeqCliConnectionConfig { ServerUrl = _url, ApiKey = _apiKey }; | ||
SeqCliConfig.Write(config); | ||
return 0; | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.Error("Could not create profile: {ErrorMessage}", Presentation.FormattedMessage(ex)); | ||
return 1; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using SeqCli.Config; | ||
|
||
namespace SeqCli.Cli.Commands.Profile | ||
{ | ||
[Command("profile", "list", "List connection profiles", | ||
Example = "seqcli profile list")] | ||
class ListCommand : Command | ||
{ | ||
protected override Task<int> Run() | ||
{ | ||
var config = SeqCliConfig.Read(); | ||
|
||
foreach (var profile in config.Profiles.OrderBy(p => p.Key)) | ||
{ | ||
Console.WriteLine($"{profile.Key} ({profile.Value.ServerUrl})"); | ||
} | ||
|
||
return Task.FromResult(0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using SeqCli.Config; | ||
using SeqCli.Util; | ||
using Serilog; | ||
|
||
namespace SeqCli.Cli.Commands.Profile | ||
{ | ||
[Command("profile", "remove", "Remove a connection profile", | ||
Example = "seqcli profile remove -n Production")] | ||
class RemoveCommand : Command | ||
{ | ||
string _name; | ||
|
||
public RemoveCommand() | ||
{ | ||
Options.Add("n=|name=", | ||
"The name of the connection profile to remove", | ||
v => _name = ArgumentString.Normalize(v)); | ||
} | ||
|
||
protected override Task<int> Run() | ||
{ | ||
return Task.FromResult(RunSync()); | ||
} | ||
|
||
int RunSync() | ||
{ | ||
if (_name == null) | ||
{ | ||
Log.Error("A profile name is required"); | ||
return 1; | ||
} | ||
|
||
try | ||
{ | ||
var config = SeqCliConfig.Read(); | ||
if (!config.Profiles.Remove(_name)) | ||
{ | ||
Log.Error("No profile with name {ProfileName} was found", _name); | ||
return 1; | ||
} | ||
|
||
SeqCliConfig.Write(config); | ||
|
||
return 0; | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.Error("Could not create profile: {ErrorMessage}", Presentation.FormattedMessage(ex)); | ||
return 1; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.