Skip to content

Commit 46e5424

Browse files
committed
Merge branch 'development'
2 parents 947b09a + 1c0769b commit 46e5424

File tree

5 files changed

+98
-9
lines changed

5 files changed

+98
-9
lines changed

.github/workflows/ci.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ jobs:
8484
- name: Build
8585
run: dotnet build --configuration Release
8686

87+
- name: Load Environment Variables
88+
id: env_vars
89+
uses: falti/[email protected]
90+
8791
- name: Run Tests
88-
run: docker-compose --env-file ../../../.env up
92+
run: |
93+
docker-compose build --build-arg NWNX_VERSION=${{ steps.env_vars.outputs.nwnx_version }} --build-arg BINARY_PATH=NWN.Anvil/bin/Release/net7.0
94+
docker-compose up
8995
working-directory: NWN.Anvil.Tests/bin/Release/
9096

9197
- name: Install NUnit

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## 8193.35.1
7+
https://github.com/nwn-dotnet/Anvil/compare/v8193.35.0...v8193.35.1
8+
9+
### Fixed
10+
- (Docker) Fixed an issue with libssl dependency.
11+
612
## 8193.35.0
713
https://github.com/nwn-dotnet/Anvil/compare/v8193.34.28...v8193.35.0
814

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
version: '3'
22
services:
33
anvil:
4-
image: "nwnxee/unified:${NWNX_VERSION}"
4+
build:
5+
context: ${PWD-.}/../../../
6+
dockerfile: ${PWD-.}/../../../dockerfile
57
env_file:
68
- ${PWD-.}/config/nwserver.env
79
volumes:
8-
- ${PWD-.}/../../../NWN.Anvil/bin/Release/net7.0:/nwn/anvil
910
- ${PWD-.}/NWN.Anvil.Tests:/nwn/run/anvil/Plugins/NWN.Anvil.Tests
1011
- ${PWD-.}/../../../NWN.Anvil.TestRunner/bin/Release/NWN.Anvil.TestRunner:/nwn/run/anvil/Plugins/NWN.Anvil.TestRunner
1112
- ${PWD-.}/results:/nwn/run/anvil/PluginData/NWN.Anvil.TestRunner
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Net.Http;
2+
using NUnit.Framework;
3+
4+
namespace Anvil.Tests.System
5+
{
6+
[TestFixture(Category = "TestRunner")]
7+
public sealed class HttpClientTests
8+
{
9+
[Test]
10+
[TestCase("http://github.com")]
11+
[TestCase("https://github.com")]
12+
public void InvokeHttpRequestIsSuccessful(string uri)
13+
{
14+
using HttpClient httpClient = new HttpClient();
15+
HttpResponseMessage response = httpClient.Send(new HttpRequestMessage(HttpMethod.Get, uri));
16+
17+
Assert.That(response.IsSuccessStatusCode, Is.True, $"'{uri}' return a non-success code: {response.StatusCode}");
18+
}
19+
}
20+
}

dockerfile

+62-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
1-
# Configure nwserver to run with nwnx
1+
# Load nwnx image to import nwserver + nwnx plugins
22
ARG NWNX_VERSION
3-
FROM nwnxee/unified:${NWNX_VERSION}
3+
FROM nwnxee/unified:${NWNX_VERSION} as nwnx
4+
5+
# Remove incompatible plugins
6+
RUN rm -rf /nwn/nwnx/NWNX_Ruby.so \
7+
/nwn/nwnx/NWNX_SpellChecker.so \
8+
/nwn/nwnx/NWNX_Redis.so
9+
10+
FROM ubuntu:20.04
11+
12+
COPY --from=nwnx /nwn /nwn
13+
14+
RUN apt-get update \
15+
&& apt-get --no-install-recommends -y install ca-certificates wget \
16+
&& wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
17+
&& dpkg -i packages-microsoft-prod.deb \
18+
&& rm packages-microsoft-prod.deb \
19+
&& apt-get update \
20+
&& apt-get --no-install-recommends -y install libc6 libstdc++6 \
21+
hunspell \
22+
default-libmysqlclient-dev \
23+
libmariadb3 \
24+
libpq5 \
25+
libsqlite3-0 \
26+
luajit libluajit-5.1-2 \
27+
inotify-tools \
28+
patch \
29+
unzip \
30+
dotnet-runtime-7.0 \
31+
dotnet-apphost-pack-7.0 \
32+
&& rm -rf /var/cache/apt /var/lib/apt/lists/*
433

34+
# Copy Anvil Binaries
535
ARG BINARY_PATH
636
COPY ${BINARY_PATH} /nwn/anvil/
737

@@ -11,11 +41,37 @@ ENV ANVIL_IMAGE=1
1141
# Set which kill signal to exit upon
1242
STOPSIGNAL SIGINT
1343

14-
# Enable and configure DotNET plugins + dependencies
44+
# Patch run-server.sh with our modifications
45+
COPY ./scripts/run-server.patch /nwn
46+
RUN patch /nwn/run-server.sh < /nwn/run-server.patch
47+
48+
# User Data
49+
VOLUME /nwn/home
50+
51+
# Configure nwserver to run with nwnx
52+
ENV NWNX_CORE_LOAD_PATH=/nwn/nwnx/
53+
ENV NWN_LD_PRELOAD="/nwn/nwnx/NWNX_Core.so"
54+
55+
# Configure nwnx to run with anvil
1556
ENV NWNX_DOTNET_SKIP=n
1657
ENV NWNX_SWIG_DOTNET_SKIP=n
1758
ENV NWNX_DOTNET_ASSEMBLY=/nwn/anvil/NWN.Anvil
1859

19-
# Patch run-server.sh with our modifications
20-
COPY ./scripts/run-server.patch /nwn
21-
RUN patch /nwn/run-server.sh < /nwn/run-server.patch
60+
# Use NWNX_ServerLogRedirector as default log manager
61+
ENV NWNX_SERVERLOGREDIRECTOR_SKIP=n
62+
ENV NWN_TAIL_LOGS=n
63+
ENV NWNX_CORE_LOG_LEVEL=6
64+
ENV NWNX_SERVERLOGREDIRECTOR_LOG_LEVEL=6
65+
66+
# Disable all other plugins by default.
67+
ENV NWNX_CORE_SKIP_ALL=y
68+
69+
# Entrypoint & Executable
70+
EXPOSE ${NWN_PORT:-5121}/udp
71+
72+
RUN chmod +x /nwn/data/bin/linux-amd64/nwserver
73+
RUN chmod +x /nwn/run-server.sh
74+
ENV NWN_EXTRA_ARGS="-userdirectory /nwn/run"
75+
76+
WORKDIR /nwn/data/bin/linux-amd64
77+
ENTRYPOINT ["/bin/bash", "/nwn/run-server.sh"]

0 commit comments

Comments
 (0)