Bump version to 1.1.4
Added build script to solution files Added address to configure client connection destination (if proxied) Added automatic semantic versioning build
This commit is contained in:
parent
6920d1a2b3
commit
bbdd5ce586
@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
|
|||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE65C879-794A-4695-B659-7376FE7DB5E3}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE65C879-794A-4695-B659-7376FE7DB5E3}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
|
build.py = build.py
|
||||||
MinecraftDiscordBot\bin\Debug\net6.0\config.json = MinecraftDiscordBot\bin\Debug\net6.0\config.json
|
MinecraftDiscordBot\bin\Debug\net6.0\config.json = MinecraftDiscordBot\bin\Debug\net6.0\config.json
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
@ -11,8 +11,11 @@ public class BotConfiguration : IBotConfiguration, IBotConfigurator {
|
|||||||
[JsonProperty("token", Required = Required.Always)]
|
[JsonProperty("token", Required = Required.Always)]
|
||||||
[Option('t', "token", HelpText = "The Discord bot token", Required = true)]
|
[Option('t', "token", HelpText = "The Discord bot token", Required = true)]
|
||||||
public string Token { get; init; } = default!;
|
public string Token { get; init; } = default!;
|
||||||
|
[JsonProperty("address", Required = Required.Always)]
|
||||||
|
[Option('a', "address", HelpText = "The connection string for the websocket", Required = true)]
|
||||||
|
public string Address { get; init; } = default!;
|
||||||
[JsonProperty("port", Required = Required.DisallowNull)]
|
[JsonProperty("port", Required = Required.DisallowNull)]
|
||||||
[Option('p', "port", Default = DEFAULT_PORT, HelpText = "The websocket server port")]
|
[Option('p', "port", Default = DEFAULT_PORT, HelpText = "The websocket server listen port")]
|
||||||
public int Port { get; init; } = DEFAULT_PORT;
|
public int Port { get; init; } = DEFAULT_PORT;
|
||||||
[JsonProperty("channels", Required = Required.Always)]
|
[JsonProperty("channels", Required = Required.Always)]
|
||||||
[Option('c', "channel", HelpText = "The list of whitelisted channels", Required = true, Min = 1)]
|
[Option('c', "channel", HelpText = "The list of whitelisted channels", Required = true, Min = 1)]
|
||||||
|
@ -210,6 +210,7 @@ local function playerStatusEventListener(socket)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
printError("playerDetector not connected!")
|
printError("playerDetector not connected!")
|
||||||
|
sleep(5)
|
||||||
end
|
end
|
||||||
while true do
|
while true do
|
||||||
local pd = peripheral.find("playerDetector")
|
local pd = peripheral.find("playerDetector")
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<Version>1.1.3</Version>
|
<Version>1.1.4</Version>
|
||||||
<Authors>Michael Chen</Authors>
|
<Authors>Michael Chen</Authors>
|
||||||
<Company>$(Authors)</Company>
|
<Company>$(Authors)</Company>
|
||||||
<RepositoryUrl>https://gitlab.com/chenmichael/mcdiscordbot</RepositoryUrl>
|
<RepositoryUrl>https://gitlab.com/chenmichael/mcdiscordbot</RepositoryUrl>
|
||||||
|
@ -50,7 +50,7 @@ public class Program : IDisposable, ICommandHandler<ResponseType>, IUserRoleMana
|
|||||||
if (stream is null) throw new FileNotFoundException("Client script could not be loaded!");
|
if (stream is null) throw new FileNotFoundException("Client script could not be loaded!");
|
||||||
using var sr = new StreamReader(stream);
|
using var sr = new StreamReader(stream);
|
||||||
return sr.ReadToEnd()
|
return sr.ReadToEnd()
|
||||||
.Replace("$HOST", $"ws://{config.SocketHost}:{config.Port}");
|
.Replace("$HOST", config.Address);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task Broadcast(Func<ITextChannel, Task<IUserMessage>> message)
|
private Task Broadcast(Func<ITextChannel, Task<IUserMessage>> message)
|
||||||
|
22
build.py
22
build.py
@ -15,20 +15,18 @@ platforms = ['linux/amd64', 'linux/arm64', 'linux/arm/v7']
|
|||||||
def pull(image):
|
def pull(image):
|
||||||
subprocess.run([dockercmd, 'pull', baseimage], check=True)
|
subprocess.run([dockercmd, 'pull', baseimage], check=True)
|
||||||
|
|
||||||
def build(image, directory, platforms, build_args = None):
|
def build(images, directory, platforms, build_args = None):
|
||||||
if build_args is None:
|
if build_args is None:
|
||||||
build_args = []
|
build_args = []
|
||||||
build_args = list(chain.from_iterable(['--build-arg', f'{arg}={val}'] for (arg, val) in build_args))
|
build_args = list(chain.from_iterable(['--build-arg', f'{arg}={val}'] for (arg, val) in build_args))
|
||||||
|
tags = list(chain.from_iterable(['-t', image] for image in images))
|
||||||
platformlist = ','.join(platforms)
|
platformlist = ','.join(platforms)
|
||||||
subprocess.run([dockercmd, 'buildx', 'build', '-f', 'MinecraftDiscordBot/Dockerfile', '--platform', platformlist, '-t', image] + build_args + ['--push', directory], check=True)
|
command = [dockercmd, 'buildx', 'build', '-f', 'MinecraftDiscordBot/Dockerfile', '--platform', platformlist, *tags] + build_args + ['--push', directory]
|
||||||
|
print(' '.join(command))
|
||||||
|
subprocess.run(command, check=True)
|
||||||
for tag in args.tags:
|
|
||||||
targetimage = f'chenio/mcdiscordbot:{tag}'
|
|
||||||
baseimage = f'mcr.microsoft.com/dotnet/runtime:6.0'
|
|
||||||
|
|
||||||
#print(f'Pulling base image {baseimage}')
|
|
||||||
#pull(baseimage)
|
|
||||||
print(f'Building image {targetimage} from {baseimage}.')
|
|
||||||
build(targetimage, '.', platforms, [('TAG', tag)])
|
|
||||||
|
|
||||||
|
for version in args.tags:
|
||||||
|
parts = version.split('.')
|
||||||
|
tags = list('.'.join(parts[:i]) for i in range(1, len(parts) + 1))
|
||||||
|
tags.append('latest')
|
||||||
|
build([f'chenio/mcdiscordbot:{tag}' for tag in tags], '.', platforms)
|
||||||
|
Loading…
Reference in New Issue
Block a user