This commit is contained in:
Clemens Vasters 2019-12-03 16:56:30 +01:00
Родитель 8ca35734ef
Коммит 7e465f5985
16 изменённых файлов: 345 добавлений и 327 удалений

Просмотреть файл

@ -8,16 +8,6 @@
<Import Project="build\repo.props" />
<Import Project="build\dependencies.props" />
<PropertyGroup>
<WindowsOnly>false</WindowsOnly>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net462;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.16.04-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup>
<Product>Microsoft Azure Relay Bridge</Product>
<RepositoryUrl>https://github.com/Azure/azure-relay-bridge</RepositoryUrl>

54
azure-pipelines.yml Normal file
Просмотреть файл

@ -0,0 +1,54 @@
# Azure Pipelines Build
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
BuildVersion.MajorMinor: 0.3
BuildVersion.Revision: $[counter(variables['Version.MajorMinor'], 0)]
BuildVersion: $(BuildVersion.MajorMinor).$(BuildVersion.Revision)
jobs:
- job: WindowsBuild
workspace:
clean: all
pool:
vmImage: 'windows-latest'
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
feedsToUse: 'select'
- task: MSBuild@1
inputs:
solution: '**/*.sln'
msbuildArguments: '/t:clean,package /p:WindowsOnly=true /p:Configuration=Release /p:VersionPrefix=$(BuildVersion) /p:VersionSuffix=rel'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '/p:WindowsOnly=true'
- publish: $(System.DefaultWorkingDirectory)\artifacts\build\net462
artifact: WindowsBuild
- job: LinuxBuild
workspace:
clean: all
pool:
vmImage: 'ubuntu-latest'
steps:
- task: ShellScript@1
inputs:
scriptPath: './package.sh'
arguments: '/p:VersionSuffix=rel'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '/p:RuntimeIdentifier=ubuntu-x64 /p:Configuration=Debug'
- publish: $(System.DefaultWorkingDirectory)/artifacts/build/netcoreapp3.0
artifact: XBuild

Просмотреть файл

@ -31,7 +31,8 @@
<MicrosoftExtensionsLoggingPackageVersion>3.0.0</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0</MicrosoftExtensionsLoggingConsolePackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
<DotnetXunitPackageVersion>2.3.1</DotnetXunitPackageVersion>
<NuGetVersioningVersion>5.3.1</NuGetVersioningVersion>
<DotnetXunitPackageVersion>2.4.1</DotnetXunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.1</XunitRunnerVisualStudioPackageVersion>
<XunitRunnerMsBuildPackageVersion>2.4.0</XunitRunnerMsBuildPackageVersion>
<NewtonsoftJsonPackageVersion>12.0.3</NewtonsoftJsonPackageVersion>

Просмотреть файл

@ -6,7 +6,7 @@
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.16.04-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.18.04-x64;ubuntu.16.10-x64;ubuntu.18.10-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>

Просмотреть файл

@ -1,3 +1,3 @@
if not "%APPVEYOR_BUILD_VERSION%"=="" set _VersionProp="/p:VersionPrefix=%APPVEYOR_BUILD_VERSION%"
msbuild /t:clean,restore,build /p:WindowsOnly=true /p:Configuration=Debug %_BuildProp% %_VersionProp% %*
msbuild /t:clean,restore,build,package /p:WindowsOnly=true /p:Configuration=Release %_BuildProp% %_VersionProp% %*
if not "%BUILDVERSION%"=="" set _VersionProp="/p:VersionPrefix=%BUILDVERSION%"
msbuild /t:clean,build,package /p:WindowsOnly=true /p:Configuration=Release %_BuildProp% %_VersionProp% %*

Просмотреть файл

@ -1,7 +1,7 @@
#!/bin/bash
pushd "${0%/*}" > /dev/null
if [ ! -z $APPVEYOR_BUILD_VERSION ]; then _VersionProp="/p:VersionPrefix=$APPVEYOR_BUILD_VERSION"; fi
if [ ! -z $BUILDVERSION ]; then _VersionProp="/p:VersionPrefix=$BUILDVERSION"; fi
dotnet restore
dotnet msbuild /t:clean,restore,build /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:clean,restore,build,package /p:Configuration=Release /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
popd

Просмотреть файл

@ -1 +1 @@
msbuild -t:Clean,Restore,Build $args
msbuild -t:Clean,Build $args

Просмотреть файл

@ -1,13 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsOnly>false</WindowsOnly>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net462;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.16.04-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
<PropertyGroup>
@ -64,6 +58,16 @@
</Compile>
</ItemGroup>
<PropertyGroup>
<PostInstallScript>
</PostInstallScript>
<PostRemoveScript>
if [ -f /etc/profile.d/azbridge.sh ]; then
rm /etc/profile.d/azbridge.sh;
fi
</PostRemoveScript>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Update="Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>

Просмотреть файл

@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsOnly>false</WindowsOnly>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net462;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<!-- <TargetFrameworks>$(CoreFrameworks)</TargetFrameworks> -->
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.16.04-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
</PropertyGroup>
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<OutputType>Exe</OutputType>
@ -28,25 +28,24 @@
</PropertyGroup>
<!-- <ItemGroup>
<None Remove="azbridge_config.machine.yml" />
<None Remove="azbridge_config.svc.yml" />
</ItemGroup> -->
<ItemGroup>
<!-- <LinuxFolder Include="/etc/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" /> -->
<Content Include="azbridge_config.svc.yml" CopyToOutputDirectory="PreserveNewest">
<LinuxPath>/etc/azbridge/azbridge_config.yml</LinuxPath>
<LinuxFolder Include="/var/log/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))"/>
<LinuxFolder Include="/etc/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))"/>
<Content Include="azbridge_config.svc.yml" CopyToPublishDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))">
<LinuxPath>/etc/azbridge/azbridge_config.svc.yml</LinuxPath>
</Content>
<Content Include="azbridge_config.machine.yml" CopyToOutputDirectory="PreserveNewest">
<LinuxPath>/etc/azbridge/azbridge_config.yml</LinuxPath>
<Content Include="azbridge_config.machine.yml" CopyToPublishDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))">
<LinuxPath>/etc/azbridge/azbridge_config.machine.yml</LinuxPath>
</Content>
<Content Include="debpostinst.sh" CopyToOutputDirectory="PreserveNewest"/>
<Content Include="debpostrm.sh" CopyToOutputDirectory="PreserveNewest"/>
<Content Include="../tools/Powershell/add-hostname.ps1" CopyToOutputDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/Powershell/remove-hostname.ps1" CopyToOutputDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/Powershell/get-hostname.ps1" CopyToOutputDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/bash/hostnames.sh" CopyToOutputDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))" />
<LinuxFolder Include="/etc/profile.d" Group="azbridge" Owner="azbridge" RemoveOnUninstall="false" Condition="! $(RuntimeIdentifier.StartsWith('win'))"/>
<Content Include="azbridge.sh" CopyToPublishDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))" RemoveOnUninstall="true">
<LinuxPath>/etc/profile.d/azbridge.sh</LinuxPath>
<LinuxFileMode>0555</LinuxFileMode>
</Content>
<Content Include="../tools/Powershell/add-hostname.ps1" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/Powershell/remove-hostname.ps1" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/Powershell/get-hostname.ps1" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
</ItemGroup>
<Choose>
@ -85,13 +84,6 @@
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>
<!--<DotNetCliToolReference Include="dotnet-rpm" Version="$(DotnetRpmPackageVersion)" />
<DotNetCliToolReference Include="dotnet-deb" Version="$(DotnetDebPackageVersion)" />
<DotNetCliToolReference Include="dotnet-tarball" Version="$(DotnetTarballPackageVersion)" />
<DotNetCliToolReference Include="dotnet-zip" Version="$(DotnetZipPackageVersion)" />-->
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup>
@ -117,11 +109,18 @@
</ItemGroup>
<!-- Fedora, CentOS, and RHEL dependencies -->
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('fedora'))">
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('fedora')) OR $(RuntimeIdentifier.StartsWith('ol'))">
<RpmDependency Include="libstdc++" Version="" />
<RpmDependency Include="libunwind" Version="" />
<RpmDependency Include="libicu" Version="" />
<RpmDependency Include="compat-openssl10" Version="" />
</ItemGroup>
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('fedora'))">
<RpmDotNetDependency Include="compat-openssl10" Version="" />
</ItemGroup>
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('ol'))">
<RpmDotNetDependency Include="openssl-libs" Version="" />
</ItemGroup>
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('centos'))">
@ -135,29 +134,22 @@
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('debian')) OR $(RuntimeIdentifier.StartsWith('ubuntu')) OR $(RuntimeIdentifier.StartsWith('linuxmint'))">
<!-- <DebDependency Include="lttng-ust" Version=""/> -->
<DebDependency Include="libcurl3" Version="" />
<DebDependency Include="libcurl3" Version="" Condition="$(RuntimeIdentifier.StartsWith('debian.8')) OR $(RuntimeIdentifier.StartsWith('ubuntu.14')) OR $(RuntimeIdentifier.StartsWith('ubuntu.15')) OR $(RuntimeIdentifier.StartsWith('ubuntu.16'))"/>
<DebDependency Include="libcurl4" Version="" Condition= "$(RuntimeIdentifier.StartsWith('debian.9')) OR $(RuntimeIdentifier.StartsWith('debian.10')) OR $(RuntimeIdentifier.StartsWith('ubuntu.18'))"/>
<DebDependency Include="libssl1.0.0" Version="" />
<DebDependency Include="libkrb5-3" Version="" />
<DebDependency Include="zlib1g" Version="" />
<DebDependency Include="libicu52" Version="" Condition="'$(RuntimeIdentifier)'=='debian.8' OR '$(RuntimeIdentifier)'=='ubuntu.14'" />
<DebDependency Include="libicu55" Version="" Condition="'$(RuntimeIdentifier)'=='ubuntu.16'" />
<DebDependency Include="libicu57" Version="" Condition="'$(RuntimeIdentifier)'=='debian.9' OR '$(RuntimeIdentifier)'=='ubuntu.17' OR '$(RuntimeIdentifier)'=='linuxmint.17'" />
<DebDependency Include="libicu60" Version="" Condition="'$(RuntimeIdentifier)'=='debian.10' OR '$(RuntimeIdentifier)'=='ubuntu.18' OR '$(RuntimeIdentifier)'=='linuxmint.18'" />
<DebDependency Include="libicu52" Version="" Condition= "$(RuntimeIdentifier.StartsWith('debian.8')) OR $(RuntimeIdentifier.StartsWith('ubuntu.14'))" />
<DebDependency Include="libicu55" Version="" Condition= "$(RuntimeIdentifier.StartsWith('ubuntu.16'))" />
<DebDependency Include="libicu57" Version="" Condition= "$(RuntimeIdentifier.StartsWith('debian.9')) OR $(RuntimeIdentifier.StartsWith('ubuntu.17')) OR $(RuntimeIdentifier.StartsWith('linuxmint.17'))" />
<DebDependency Include="libicu60" Version="" Condition= "$(RuntimeIdentifier.StartsWith('debian.10')) OR $(RuntimeIdentifier.StartsWith('ubuntu.18')) OR $(RuntimeIdentifier.StartsWith('linuxmint.18'))" />
</ItemGroup>
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith('debian')) OR $(RuntimeIdentifier.StartsWith('ubuntu')) OR $(RuntimeIdentifier.StartsWith('linuxmint'))">
<!--
The .DEB Packager doesn't correctly place files into directories other
than the target, so we create the profile startup file on the fly here.
The profile startup file buts the tool on the path and also registers
the addhost and removehost bash extensions.
DO NOT CHANGE THE FORMATTING BELOW.
-->
<PostInstallScript>. /usr/share/azbridge/debpostinst.sh</PostInstallScript>
<PostRemoveScript>. /usr/share/azbridge/debpostrm.sh</PostRemoveScript>
</PropertyGroup>
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('opensuse'))">
<RpmDotNetDependency Include="libopenssl1_0_0" Version="" />
<RpmDotNetDependency Include="libicu52_1" Version="" />
<RpmDotNetDependency Include="krb5" Version="" />
</ItemGroup>
<!-- Linux Daemon install properties -->
<PropertyGroup Condition="$(UnixRuntimeIdentifiers.Contains($(RuntimeIdentifier)))">

Просмотреть файл

@ -1,5 +1,7 @@
#!/bin/bash
export PATH="$PATH:/usr/share/azbridge"
# remove specified host from /etc/hosts
function removehost() {

Просмотреть файл

@ -1,11 +0,0 @@
echo '#!/bin/bash' > /etc/profile.d/azbridge.sh
echo 'export PATH="\$PATH:/usr/share/azbridge"' >> /etc/profile.d/azbridge.sh
echo '. /usr/share/azbridge/hostnames.sh' >> /etc/profile.d/azbridge.sh
chmod a+x /etc/profile.d/azbridge.sh
if [ ! -d "/etc/azbridge" ]; then
mkdir /etc/azbridge;
fi
if [ ! -f "/etc/azbridge/azbridge_config.machine.yml" ]; then
mv /usr/share/azbridge/azbridge_config.machine.yml /etc/azbridge/azbridge_config.machine.yml;
fi
/etc/profile.d/azbridge.sh

Просмотреть файл

@ -1,3 +0,0 @@
if [ -f /etc/profile.d/azbridge.sh ]; then
rm /etc/profile.d/azbridge.sh;
fi

Просмотреть файл

@ -10,7 +10,7 @@ if "%TargetFramework%"=="" set TargetFramework="netcoreapp3.0"
pushd "%~dp0"
if not exist "tmp" mkdir tmp
set DebFile=azbridge.%VersionPrefix%-%VersionSuffix%.ubuntu.16.04-x64.deb
set DebFile=azbridge.%VersionPrefix%-%VersionSuffix%.ubuntu.18.10-x64.deb
copy /y ..\..\..\artifacts\build\%TargetFramework%\%DebFile% tmp > NUL
docker build -f Dockerfile . --tag azbridge_ubuntu1604_test --build-arg deb_package=%DebFile%
rd /s /q tmp

Просмотреть файл

@ -10,7 +10,7 @@ if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
pushd "${0%/*}" > /dev/null
if [ ! -d "tmp" ]; then mkdir tmp; fi
DebFile=azbridge.$VersionPrefix-$VersionSuffix.ubuntu.16.04-x64.deb
DebFile=azbridge.$VersionPrefix-$VersionSuffix.ubuntu.18.10-x64.deb
cp ../../../artifacts/build/$TargetFramework/$DebFile tmp/ > /dev/null
docker build -f Dockerfile . --tag azbridge_ubuntu1604_test --build-arg deb_package=$DebFile

Просмотреть файл

@ -1,16 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsOnly>false</WindowsOnly>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net462;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<!-- <TargetFrameworks>$(CoreFrameworks)</TargetFrameworks> -->
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.8-x64;ubuntu.16.10-x64;ubuntu.16.04-x64;opensuse-x64;ol-x64;rhel-x64;fedora-x64;centos-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup>
<IsPackable>false</IsPackable>
<Description>Azure Relay Bridge Tests</Description>