Skip to content
Permalink
Browse files

Merge pull request #7 from automatica-core/develop

Develop
  • Loading branch information...
p3root committed Feb 23, 2019
2 parents a27fd2f + 625db68 commit 078e7283e0d3333531ae92c7b436f0f4998a2738
Showing with 186 additions and 81 deletions.
  1. +27 −0 .dockerignore
  2. +59 −0 docker/Dockerfile
  3. +26 −0 docker/build-packages.sh
  4. +1 −1 src/automatica.core/Automatica.Core.Base/Automatica.Core.Base.csproj
  5. +1 −1 src/automatica.core/Automatica.Core.Bootloader/Automatica.Core.Bootloader.csproj
  6. +17 −2 src/automatica.core/Automatica.Core.Bootloader/Program.cs
  7. +1 −1 src/automatica.core/Automatica.Core.Common.Update/Automatica.Core.Common.Update.csproj
  8. +1 −1 src/automatica.core/Automatica.Core.Doc/Automatica.Core.Doc.csproj
  9. +1 −1 src/automatica.core/Automatica.Core.Driver.Utility/Automatica.Core.Driver.Utility.csproj
  10. +1 −1 src/automatica.core/Automatica.Core.Driver/Automatica.Core.Driver.csproj
  11. +1 −1 src/automatica.core/Automatica.Core.EF/Automatica.Core.EF.csproj
  12. +1 −1 src/automatica.core/Automatica.Core.Internals/Automatica.Core.Internals.csproj
  13. +1 −1 src/automatica.core/Automatica.Core.Model.Standard/Automatica.Core.Model.Standard.csproj
  14. +1 −1 src/automatica.core/Automatica.Core.Model/Automatica.Core.Model.csproj
  15. +1 −1 src/automatica.core/Automatica.Core.Rule/Automatica.Core.Rule.csproj
  16. +1 −1 src/automatica.core/Automatica.Core.Runtime/Automatica.Core.Runtime.csproj
  17. +5 −5 src/automatica.core/Automatica.Core.Runtime/Core/CoreServer.cs
  18. +1 −1 src/automatica.core/Automatica.Core.Tests/Automatica.Core.Tests.csproj
  19. +1 −1 src/automatica.core/Automatica.Core.UnitTests/Automatica.Core.UnitTests.Base.csproj
  20. +1 −1 src/automatica.core/Automatica.Core.Visu/Automatica.Core.Visu.csproj
  21. +1 −1 src/automatica.core/Automatica.Core.Watchdog/Automatica.Core.Watchdog.csproj
  22. +16 −1 src/automatica.core/Automatica.Core.Watchdog/Program.cs
  23. +2 −2 src/automatica.core/Automatica.Core.WebApi/Automatica.Core.WebApi.csproj
  24. +1 −1 src/automatica.core/Automatica.Core/Automatica.Core.csproj
  25. +1 −1 src/automatica.core/Automatica.Discovery/Automatica.Discovery.csproj
  26. +1 −1 src/automatica.core/Automatica.Push/Automatica.Push.csproj
  27. +1 −1 src/automatica.core/CI/Automatica.Core.CI.CreateDatabase/Automatica.Core.CI.CreateDatabase.csproj
  28. +1 −1 src/automatica.core/CI/Automatica.Core.CI.CreateDatabase/Program.cs
  29. +1 −1 src/automatica.core/Drivers/Knx/P3.Knx.Core.Ets/P3.Knx.Core.Ets.csproj
  30. +4 −4 ....drivers/automatica.driver.automatica.remote/Automatica.Remote/P3.Driver.Automatica.Remote.csproj
  31. +1 −38 ...automatica.drivers/automatica.driver.automatica.remote/Automatica.Remote/automatica-manifest.json
  32. +1 −1 ...vers/automatica.driver.homekit/P3.Driver.HomeKit.ConsoleTest/P3.Driver.HomeKit.ConsoleTest.csproj
  33. +1 −1 ....drivers/automatica.driver.homekit/P3.Driver.HomeKit.UnitTests/P3.Driver.HomeKit.UnitTests.csproj
  34. +1 −1 src/automatica.drivers/automatica.driver.homekit/P3.Driver.HomeKit/P3.Driver.HomeKit.csproj
  35. +2 −2 ...matica.drivers/automatica.driver.homekit/P3.Driver.HomeKitFactory/P3.Driver.HomeKitFactory.csproj
  36. +2 −2 ...omatica.drivers/automatica.driver.homekit/P3.Driver.HomeKitFactory/Properties/launchSettings.json
@@ -0,0 +1,27 @@
.git
README.md
**/node_modules
/automatica.build
**/bin
**/obj
/images

[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
msbuild.log
msbuild.err
msbuild.wrn

/src/automatica.core/Automatica.WebNew/node_modules
/src/automatica.core/Automatica.Web/node_modules

# To prevent storing dev/temporary container data
*.csv
/tmp/*
@@ -0,0 +1,59 @@
ARG version

#build libserialport
FROM microsoft/dotnet:sdk AS libnserial
WORKDIR /app
ARG version

RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install cmake build-essential

RUN mkdir /src
RUN git clone https://github.com/jcurl/serialportstream.git /src/serialportstream
RUN cd /src/serialportstream/dll/serialunix && ./build.sh
RUN cd -


FROM microsoft/dotnet:latest
WORKDIR /app

RUN apt-get update
RUN apt-get install zip -y
RUN apt-get install nginx -y

ARG version


#install automatica-cli
RUN dotnet tool install --global automatica-cli
ENV PATH="${PATH}:/root/.dotnet/tools"

# Copy everything else and build
COPY . /src

COPY --from=libnserial /src/serialportstream/dll/serialunix/bin/usr/local/lib/libnserial.so.1.1 /usr/lib
COPY --from=libnserial /src/serialportstream/dll/serialunix/bin/usr/local/lib/libnserial.so.1 /usr/lib
COPY --from=libnserial /src/serialportstream/dll/serialunix/bin/usr/local/lib/libnserial.so /usr/lib

RUN ls -lah /usr/lib

RUN dotnet publish -c Release -o /app/automatica /src/src/automatica.core/
RUN dotnet publish -c Release -o /app/automatica.bootloader /src/src/automatica.core/Automatica.Core.Bootloader

COPY ./src/automatica.core/Automatica.Core/appsettings.json /app/automatica/appsettings.json
COPY ./src/automatica.core/Automatica.Core/appsettings.json .

RUN chmod 755 /src/docker/build-packages.sh
RUN /src/docker/build-packages.sh /src $version

RUN dotnet publish -c Release -o /tmp/db/ /src/src/automatica.core/CI/Automatica.Core.CI.CreateDatabase
COPY ./src/automatica.core/Automatica.Core/appsettings.json /tmp/db/appsettings.json

RUN dotnet /tmp/db/Automatica.Core.CI.CreateDatabase.dll /app/automatica

RUN rm -rf /src
RUN rm ./appsettings.json
RUN rm -rf /tmp/db

# Build runtime image
ENTRYPOINT ["dotnet", "/app/automatica.bootloader/Automatica.Core.Bootloader.dll"]
@@ -0,0 +1,26 @@
#!/bin/bash


build() {
for i in $1/*;
do
for f in $(find $i -name 'automatica-manifest.json'); do
WORKING_DIR=$(dirname $f)

automatica-cli Pack -V $2 -W $WORKING_DIR -o /tmp

done
done

for i in /tmp/*.acpkg;
do
unzip -o $i -d /app/automatica/$3
rm $i
done
ls /app/automatica/$3
}

echo "building in $1 - version $2"

build $1/src/automatica.drivers $2 "Drivers"
build $1/src/automatica.logics $2 "Rules"
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>EFBC4EED-183B-4E60-8E6D-A1753CBE42FA</ProjectGuid>
<LangVersion>7.3</LangVersion>
@@ -3,6 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
</PropertyGroup>
</Project>
@@ -23,9 +23,24 @@ static void Main(string[] args)
Directory.Delete(tmpPath, true);
}

Console.WriteLine($"Starting {appName}");

ProcessStartInfo processInfo = new ProcessStartInfo(appName);
ProcessStartInfo processInfo = null;
if (!File.Exists(appName))
{
if(!File.Exists(appName+".dll"))
{
Console.Error.WriteLine($"Could not fine {appName} or {appName}.dll - exiting startup...");
return;
}
//maybe we don't have built the app with correct environments? so start it with dotnet Automatica.Core.Watchdog dll
Console.WriteLine($"Starting with dotnet {appName}.dll");
processInfo = new ProcessStartInfo("dotnet", appName+".dll");
}
else
{
processInfo = new ProcessStartInfo(appName);
}
Console.WriteLine($"Starting {appName}");
processInfo.WorkingDirectory = Environment.CurrentDirectory;

Process process = null;
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Copyright>p3root and automatica.core</Copyright>
<PackageProjectUrl>https://github.com/automatica-core</PackageProjectUrl>
<RepositoryUrl>https://github.com/automatica-core</RepositoryUrl>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
</PropertyGroup>
<ItemGroup>
<!--PackageReference Include="docfx.console" Version="2.39.2">
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>8544FAAC-CC7F-4330-9C19-61A6FC91182C</ProjectGuid>
<LangVersion>7.3</LangVersion>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>BCC1EC6F-8FCF-45CB-87FF-5744693A9ED4</ProjectGuid>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>CB99914A-2CF8-4047-8D63-8E760BA303A1</ProjectGuid>
<Authors>p3root</Authors>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
</PropertyGroup>
<ItemGroup>
<None Remove="pub.txt" />
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Automatica.Core.Model\Models\User\Priviledge.cs" Link="Models\User\Priviledge.cs" />
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<PackageProjectUrl>https://github.com/automatica-core</PackageProjectUrl>
<RepositoryUrl>https://github.com/automatica-core</RepositoryUrl>
<Copyright>p3root and automatica.core</Copyright>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>91142F5E-C914-4738-86FE-2BDA3D4B9509</ProjectGuid>
<Authors>p3oort</Authors>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>A07B806E-69D6-452D-BB29-7ED80501C39F</ProjectGuid>
</PropertyGroup>
@@ -460,11 +460,11 @@ private void Configure()
{
_logger.LogDebug("Searching instantiated drivers");

if(!_licenseContext.IsLicensed)
{
_logger.LogError("Can not configure drivers - license is invalid");
return;
}
//if(!_licenseContext.IsLicensed)
//{
// _logger.LogError("Can not configure drivers - license is invalid");
// return;
//}
_configuredDrivers = 0;

var root = _dbContext.NodeInstances.Single(a => a.This2ParentNodeInstance == null && !a.IsDeleted);
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>7EB1AA44-A1A3-4141-A15F-B1790E27B43E</ProjectGuid>
</PropertyGroup>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>C7BD55D0-CF95-4410-BC9B-7AD6794B814F</ProjectGuid>
<Description>Base classes for unit tests</Description>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>5255E1AB-7DEE-423D-9538-8B087D3B0ECC</ProjectGuid>
</PropertyGroup>
@@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>78F9C09E-3660-4EDA-8FA7-19AC110D78D3</ProjectGuid>
</PropertyGroup>
@@ -53,7 +53,22 @@ static void Main(string[] args)
File.Delete(Path.Combine(Path.GetTempPath(), ServerInfo.UpdateFileName));
}

ProcessStartInfo processInfo = new ProcessStartInfo(appName);
ProcessStartInfo processInfo;
if (!File.Exists(appName))
{
if (!File.Exists(appName + ".dll"))
{
logger.LogError($"Could not fine {appName} or {appName}.dll - exiting startup...");
return;
}
logger.LogInformation($"Starting with dotnet {appName}.dll");
processInfo = new ProcessStartInfo("dotnet", appName + ".dll");
}
else
{
processInfo = new ProcessStartInfo(appName);
}

processInfo.WorkingDirectory = Environment.CurrentDirectory;

Process process = null;
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>50D44EF3-6768-4C8D-9AA7-87016FB3FDEE</ProjectGuid>
</PropertyGroup>
@@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>D659A788-2D0C-4E2D-8774-998BF4F3080B</ProjectGuid>
</PropertyGroup>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>14F0A52F-4A52-456E-B3A6-D157ED90ED78</ProjectGuid>
</PropertyGroup>
@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>54D90188-19AB-4FA3-8F25-878D11C92D4D</ProjectGuid>
</PropertyGroup>
@@ -5,7 +5,7 @@
<TargetFramework>netcoreapp2.2</TargetFramework>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>285604C0-3A87-49EF-9A06-A4EE0B17D63A</ProjectGuid>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
@@ -29,7 +29,7 @@ static void Main(string[] args)
Log.Logger.Information("Starting Automatica.Core.CI database tool");

var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.SetBasePath(new FileInfo(Assembly.GetEntryAssembly().Location).DirectoryName)
.AddJsonFile("appsettings.json", true)
.Build();

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>0.6.0.239</Version>
<Version>0.7.0.257</Version>
<Configurations>Debug;Release;DebugLocal</Configurations>
<ProjectGuid>AF274AE7-266C-4ED5-B1F2-E2A1C852DAA9</ProjectGuid>
</PropertyGroup>

0 comments on commit 078e728

Please sign in to comment.
You can’t perform that action at this time.