Compare commits

...

8 Commits

Author SHA1 Message Date
Harald Wolff 1e49ba6247 Version 0.4.4
ln.build - build0.l--n.de build job pending Details
2021-07-10 02:13:00 +02:00
Harald Wolff e2a6124707 Fix version detection, use <PackageVersion> if exists, then <Version>
ln.build - build0.l--n.de build job pending Details
2021-07-10 02:12:04 +02:00
Harald Wolff 833890438f Ignore .csproj when no version set
ln.build - build0.waldrennach.l--n.de build job pending Details
2020-12-09 17:16:22 +01:00
Harald Wolff 353397e523 Sort stages by priority 2020-12-09 17:15:58 +01:00
Harald Wolff 65d64c2484 Fix WorkingDirectory in -m build mode 2020-12-09 17:15:46 +01:00
Harald Wolff 440c6af85d Fix Nullreference in CSProjHelper.GetVersion()
ln.build - build0.waldrennach.l--n.de build job pending Details
2020-12-09 13:00:43 +01:00
Harald Wolff 1b922b8096 SemVersion: fix operators >/< 2020-12-09 13:00:22 +01:00
Harald Wolff 0e17216cc9 CI Versioning 2020-12-09 12:59:49 +01:00
8 changed files with 88 additions and 68 deletions

View File

@ -65,8 +65,11 @@ namespace ln.build.server
CIService.Start();
break;
case RunMode.build:
CIJob job = new CIJob(CIService,null, (BuildSecret != null) ? CIService.GetSecretStorage(BuildSecret) : null);
CIJob job = new CIJob(CIService, null, (BuildSecret != null) ? CIService.GetSecretStorage(BuildSecret) : null);
job.WorkingDirectory = BuildPath;
job.Environment.WorkingDirectory = BuildPath;
job.RunJob();
break;
case RunMode.versioning:

View File

@ -1,31 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<Version>0.4.3</Version>
<Authors>Harald Wolff-Thobaben</Authors>
<Company>l--n.de</Company>
<Description>A simple build server scheduling builds triggered via web-hooks</Description>
<Copyright>(c) 2020 Harald Wolff-Thobaben</Copyright>
<PackageTags>build build-server</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ln.application" Version="0.1.*" />
<PackageReference Include="ln.http" Version="0.1.*" />
<PackageReference Include="ln.json" Version="1.0.*" />
<PackageReference Include="ln.logging" Version="1.0.*" />
<PackageReference Include="ln.threading" Version="0.1.*" />
<PackageReference Include="ln.type" Version="0.1.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../ln.build/ln.build.csproj" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageVersion>0.4.4</PackageVersion>
</PropertyGroup>
<PropertyGroup>
<Version>0.4.4-ci</Version>
<Authors>Harald Wolff-Thobaben</Authors>
<Company>l--n.de</Company>
<Description>A simple build server scheduling builds triggered via web-hooks</Description>
<Copyright>(c) 2020 Harald Wolff-Thobaben</Copyright>
<PackageTags>build build-server</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ln.application" Version="0.1.*" />
<PackageReference Include="ln.http" Version="0.1.*" />
<PackageReference Include="ln.json" Version="1.0.*" />
<PackageReference Include="ln.logging" Version="1.0.*" />
<PackageReference Include="ln.threading" Version="0.1.*" />
<PackageReference Include="ln.type" Version="0.1.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../ln.build/ln.build.csproj" />
</ItemGroup>
</Project>

View File

@ -55,7 +55,7 @@ namespace ln.build
Logger = new Logger(new FileLogger(Path.Combine(ciService.ReportsDirectory, JobID, "build.log")));
Logger.Backends.Add(Logger.ConsoleLogger);
Environment = new CommandEnvironment(){ CIJob = this };
Environment = new CommandEnvironment(){ CIJob = this, WorkingDirectory = WorkingDirectory };
}
public Stream GetLogStream(string name)

View File

@ -1,32 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<Version>0.4.3</Version>
<Authors>Harald Wolff-Thobaben</Authors>
<Company>l--n.de</Company>
<Description>A simple build server scheduling builds triggered via web-hooks</Description>
<Copyright>(c) 2020 Harald Wolff-Thobaben</Copyright>
<PackageTags>build build-server</PackageTags>
</PropertyGroup>
<ItemGroup>
<None Update="html/**" CopyToOutputDirectory="PreserveNewest" />
<None Update="scripts/**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ln.logging" Version="1.0.*" />
<PackageReference Include="ln.threading" Version="0.1.*" />
<PackageReference Include="ln.json" Version="1.0.*" />
<PackageReference Include="ln.http" Version="0.1.*" />
<PackageReference Include="ln.templates" Version="0.1.*" />
<PackageReference Include="ln.templates.http" Version="0.0.*" />
<PackageReference Include="ln.type" Version="0.1.*" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageVersion>0.4.4</PackageVersion>
</PropertyGroup>
<PropertyGroup>
<Version>0.4.4-ci</Version>
<Authors>Harald Wolff-Thobaben</Authors>
<Company>l--n.de</Company>
<Description>A simple build server scheduling builds triggered via web-hooks</Description>
<Copyright>(c) 2020 Harald Wolff-Thobaben</Copyright>
<PackageTags>build build-server</PackageTags>
</PropertyGroup>
<ItemGroup>
<None Update="html/**" CopyToOutputDirectory="PreserveNewest" />
<None Update="scripts/**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ln.logging" Version="1.0.*" />
<PackageReference Include="ln.threading" Version="0.1.*" />
<PackageReference Include="ln.json" Version="1.0.*" />
<PackageReference Include="ln.http" Version="0.1.*" />
<PackageReference Include="ln.templates" Version="0.1.*" />
<PackageReference Include="ln.templates.http" Version="0.0.*" />
<PackageReference Include="ln.type" Version="0.1.*" />
</ItemGroup>
</Project>

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using ln.build.commands;
using ln.build.semver;
using ln.json;
@ -78,6 +79,8 @@ namespace ln.build.pipeline
public void Run()
{
stages.Sort((a,b)=>a.Priority-b.Priority);
foreach (Stage stage in stages)
{
CommandEnvironment.Logger.Log(LogLevel.INFO,"-------------------------------------------------------------------------------------");

View File

@ -40,7 +40,6 @@ namespace ln.build.commands
foreach (string projectFileName in projectFiles)
{
stage.PipeLine.CommandEnvironment.Extend("DOTNET_PROJECTS", projectFileName);
CSProjHelper csp = new CSProjHelper(projectFileName);
string projectName = csp.GetName();
@ -49,8 +48,13 @@ namespace ln.build.commands
stage.CommandEnvironment.Logger.Log(LogLevel.INFO, "dotnet prepare: project {0} version={1} type={2}", projectName, projectVersion, ot);
if (projectVersion == null)
continue;
if (projectVersion > highestVersion)
highestVersion = projectVersion;
stage.PipeLine.CommandEnvironment.Extend("DOTNET_PROJECTS", projectFileName);
}
stage.PipeLine.CommandEnvironment.Set("RELEASE_VERSION", highestVersion.ToString());

View File

@ -2,8 +2,10 @@
using System;
using System.IO;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Text.RegularExpressions;
using Jint.Parser.Ast;
using ln.build.semver;
using Microsoft.VisualBasic;
@ -81,6 +83,9 @@ namespace ln.build.semver
public static bool operator <(SemVersion a,SemVersion b)
{
if (a is null || b is null)
return false;
if (a.Major < b.Major)
return true;
if (a.Major > b.Major)
@ -108,6 +113,9 @@ namespace ln.build.semver
}
public static bool operator >(SemVersion b,SemVersion a)
{
if (a is null || b is null)
return false;
if (a.Major < b.Major)
return true;
if (a.Major > b.Major)

View File

@ -29,8 +29,8 @@ namespace ln.build.support.dotnet
{
XmlDocument projectFile = new XmlDocument();
projectFile.Load(FileName);
XmlNode nodeVersion = projectFile.SelectSingleNode("Project/PropertyGroup/Version");
return SemVersion.Parse(nodeVersion.InnerText);
XmlNode nodeVersion = projectFile.SelectSingleNode("Project/PropertyGroup/PackageVersion") ?? projectFile.SelectSingleNode("Project/PropertyGroup/Version");
return (nodeVersion == null) ? null : SemVersion.Parse(nodeVersion.InnerText);
}
public void SetVersion(SemVersion version)