1
0
Fork 0
mirror of https://github.com/Corsinvest/cv4pve-pepper.git synced 2025-02-12 10:01:53 +00:00

Support multiple host for HA

Check-Update and Upgrade application
This commit is contained in:
Daniele Corsini 2019-12-17 11:26:15 +01:00
parent d91ff4e64c
commit a4e8d7ef9f
6 changed files with 785 additions and 762 deletions

7
.editorconfig Normal file
View file

@ -0,0 +1,7 @@
# All files
[*]
guidelines = 80
# C# or VB files
[*.{cs,vb}]
guidelines = 80, 120

View file

@ -15,12 +15,21 @@ Usage: cv4pve-pepper [options]
Options: Options:
-?|-h|--help Show help information -?|-h|--help Show help information
--host The host name host[:port] --version Show version information
--username User name <username>@<realm> --host The host name host[:port],host1[:port],host2[:port]
--password The password. Specify 'file:path_file' to store password in file. --username User name <username>@<realm>
--version Show version information --password The password. Specify 'file:path_file' to store password in file.
--vmid The id or name VM/CT --vmid The id or name VM/CT
--viewer Executable SPICE client remote viewer``` --viewer Executable SPICE client remote viewer
Commands:
app-check-update Check update application
app-upgrade Upgrade application
Run 'cv4pve-pepper [command] --help' for more information about a command.
cv4pve-pepper is a part of suite cv4pve-tools.
For more information visit https://www.cv4pve-tools.com
``` ```
## Copyright and License ## Copyright and License
@ -30,7 +39,7 @@ For licensing details please visit [LICENSE.md](LICENSE.md)
## Commercial Support ## Commercial Support
This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the [site](https://www.corsinvest.it/cv4pve-tools) This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the [site](https://www.cv4pve-tools.com)
## Introduction ## Introduction
@ -52,6 +61,8 @@ this software aims to simplify run SPICE client from Proxmox VE using command li
* Not require installation in Proxmox VE * Not require installation in Proxmox VE
* Execute out side Proxmox VE * Execute out side Proxmox VE
* Not require Web login * Not require Web login
* Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port]
* Check-Update and Upgrade application
## Configuration and use ## Configuration and use

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<Version>1.0.0</Version> <Version>1.1.0</Version>
<TargetFramework>netcoreapp3.0</TargetFramework> <TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>cv4pve-pepper</AssemblyName> <AssemblyName>cv4pve-pepper</AssemblyName>
<Company>Corsinvest Srl</Company> <Company>Corsinvest Srl</Company>
@ -16,7 +16,9 @@
<!-- Fix RedHat, Centos,Fedora --> <!-- Fix RedHat, Centos,Fedora -->
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" /> <RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Extension\Corsinvest.ProxmoxVE.Api.Extension.csproj" /> --> <TrimmerRootAssembly Include="System.Net.WebClient" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="2.1.0" />
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="1.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -10,25 +10,25 @@
* Copyright (C) 2016 Corsinvest Srl GPLv3 and CEL * Copyright (C) 2016 Corsinvest Srl GPLv3 and CEL
*/ */
using System;
using System.IO; using System.IO;
using Corsinvest.ProxmoxVE.Api.Extension.Helpers; using Corsinvest.ProxmoxVE.Api.Extension.Helpers;
using Corsinvest.ProxmoxVE.Api.Extension.Helpers.Shell; using Corsinvest.ProxmoxVE.Api.Shell.Helpers;
using McMaster.Extensions.CommandLineUtils; using McMaster.Extensions.CommandLineUtils;
namespace Corsinvest.ProxmoxVE.Pepper namespace Corsinvest.ProxmoxVE.Pepper
{ {
class Program class Program
{ {
public static readonly string APP_NAME = "cv4pve-pepper";
static int Main(string[] args) static int Main(string[] args)
{ {
var app = ShellHelper.CreateConsoleApp(APP_NAME, "Launching SPICE on Proxmox VE", true); var app = ShellHelper.CreateConsoleApp("cv4pve-pepper",
"Launching SPICE on Proxmox VE");
var optVmId = app.VmIdOrNameOption(); var optVmId = app.VmIdOrNameOption().DependOn(app, CommandOptionExtension.HOST_OPTION_NAME);
var optRemoteViewer = app.Option("--viewer", var optRemoteViewer = app.Option("--viewer",
"Executable SPICE client remote viewer", "Executable SPICE client remote viewer",
CommandOptionType.SingleValue); CommandOptionType.SingleValue)
.DependOn(app, CommandOptionExtension.HOST_OPTION_NAME);
optRemoteViewer.Accepts().ExistingFile(); optRemoteViewer.Accepts().ExistingFile();
app.OnExecute(() => app.OnExecute(() =>
@ -47,7 +47,7 @@ namespace Corsinvest.ProxmoxVE.Pepper
ret = ShellHelper.Execute(cmd, ret = ShellHelper.Execute(cmd,
true, true,
null, null,
Console.Out, app.Out,
app.DryRunIsActive(), app.DryRunIsActive(),
app.DebugIsActive()).ExitCode == 0; app.DebugIsActive()).ExitCode == 0;
} }
@ -55,7 +55,7 @@ namespace Corsinvest.ProxmoxVE.Pepper
return ret ? 0 : 1; return ret ? 0 : 1;
}); });
return app.ExecuteConsoleApp(Console.Out, args); return app.ExecuteConsoleApp(args);
} }
} }
} }

View file

@ -1,4 +1,4 @@
# This file is part of the cv4pve-pepper https://github.com/Corsinvest/cv4pve-pepper, # This file is part of the cv4pve-autosnap https://github.com/Corsinvest/cv4pve-pepper,
# #
# This source file is available under two different licenses: # This source file is available under two different licenses:
# - GNU General Public License version 3 (GPLv3) # - GNU General Public License version 3 (GPLv3)
@ -23,10 +23,13 @@ Write-Output "
== Build System == Build System
=========================================================" ========================================================="
Remove-Item -Path ".\Bin\Release\netcoreapp3.0\" -Recurse -Force
$rids = @("linux-x64", "linux-arm", "linux-arm64", "osx-x64", "win-x86", "win-x64", "win-arm", "win-arm64") $rids = @("linux-x64", "linux-arm", "linux-arm64", "osx-x64", "win-x86", "win-x64", "win-arm", "win-arm64")
foreach ($rid in $rids) { foreach ($rid in $rids) {
dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true dotnet publish -r $rid -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
$path = "bin\Release\netcoreapp3.0\$rid\publish\" $path = "bin\Release\netcoreapp3.0\$rid\publish\"
$fileName = Get-ChildItem $path -Exclude *.pdb -name $fileName = Get-ChildItem $path -Exclude *.pdb -name
$fileDest = "bin\Release\netcoreapp3.0\$fileName-$rid.zip" $fileDest = "bin\Release\netcoreapp3.0\$fileName-$rid.zip"
Remove-Item $fileDest -ErrorAction SilentlyContinue Remove-Item $fileDest -ErrorAction SilentlyContinue