Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Add the initial Catalog2Registration projects (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Dec 6, 2019
1 parent ac7c8f7 commit fb5d0f0
Show file tree
Hide file tree
Showing 23 changed files with 539 additions and 3 deletions.
45 changes: 45 additions & 0 deletions NuGet.Services.Metadata.sln
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
build.ps1 = build.ps1
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Jobs.Catalog2Registration", "src\NuGet.Jobs.Catalog2Registration\NuGet.Jobs.Catalog2Registration.csproj", "{5ABE8807-2209-4948-9FC5-1980A507C47A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Services.V3", "src\NuGet.Services.V3\NuGet.Services.V3.csproj", "{C3F9A738-9759-4B2B-A50D-6507B28A659B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Jobs.Catalog2Registration.Tests", "tests\NuGet.Jobs.Catalog2Registration.Tests\NuGet.Jobs.Catalog2Registration.Tests.csproj", "{296703A3-67BA-4876-8C1D-ACE13DF901EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Services.V3.Tests", "tests\NuGet.Services.V3.Tests\NuGet.Services.V3.Tests.csproj", "{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Jobs.RegistrationComparer", "src\NuGet.Jobs.RegistrationComparer\NuGet.Jobs.RegistrationComparer.csproj", "{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -325,6 +331,18 @@ Global
{7E6903A4-DBE1-444E-A8E3-C1DBB58243E0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7E6903A4-DBE1-444E-A8E3-C1DBB58243E0}.Release|x64.ActiveCfg = Release|Any CPU
{7E6903A4-DBE1-444E-A8E3-C1DBB58243E0}.Release|x64.Build.0 = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Debug|x64.Build.0 = Debug|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|Any CPU.Build.0 = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|x64.ActiveCfg = Release|Any CPU
{5ABE8807-2209-4948-9FC5-1980A507C47A}.Release|x64.Build.0 = Release|Any CPU
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -337,6 +355,18 @@ Global
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Release|x64.ActiveCfg = Release|Any CPU
{C3F9A738-9759-4B2B-A50D-6507B28A659B}.Release|x64.Build.0 = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|x64.ActiveCfg = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Debug|x64.Build.0 = Debug|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|Any CPU.Build.0 = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|x64.ActiveCfg = Release|Any CPU
{296703A3-67BA-4876-8C1D-ACE13DF901EF}.Release|x64.Build.0 = Release|Any CPU
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -349,6 +379,18 @@ Global
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Release|x64.ActiveCfg = Release|Any CPU
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A}.Release|x64.Build.0 = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|x64.ActiveCfg = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Debug|x64.Build.0 = Debug|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|Any CPU.Build.0 = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|x64.ActiveCfg = Release|Any CPU
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -375,8 +417,11 @@ Global
{F009209D-A663-45E1-87E8-158569A0F097} = {F1C83FD9-A498-483E-ADFA-B55D82A14965}
{F81A7CA6-97D4-4958-A9C1-FF94FCA283CB} = {C86C6DEE-84E1-4E4E-8868-6755D7A8E0E4}
{7E6903A4-DBE1-444E-A8E3-C1DBB58243E0} = {C86C6DEE-84E1-4E4E-8868-6755D7A8E0E4}
{5ABE8807-2209-4948-9FC5-1980A507C47A} = {C86C6DEE-84E1-4E4E-8868-6755D7A8E0E4}
{C3F9A738-9759-4B2B-A50D-6507B28A659B} = {5DE01C58-D5F7-482F-8256-A8333064384C}
{296703A3-67BA-4876-8C1D-ACE13DF901EF} = {F1C83FD9-A498-483E-ADFA-B55D82A14965}
{CCB4D5EF-AC84-449D-AC6E-0A0AD295483A} = {F1C83FD9-A498-483E-ADFA-B55D82A14965}
{4CE6C864-DB4D-4262-A2DD-80BB932F6E8C} = {C86C6DEE-84E1-4E4E-8868-6755D7A8E0E4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D3AB83E9-02B4-4FFA-A2D0-637F0B97E626}
Expand Down
8 changes: 6 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ Invoke-BuildStep 'Set version metadata in AssemblyInfo.cs' {
"src\NuGet.Jobs.Catalog2AzureSearch\Properties\AssemblyInfo.g.cs", `
"src\NuGet.Jobs.Owners2AzureSearch\Properties\AssemblyInfo.g.cs", `
"src\NuGet.Services.SearchService\Properties\AssemblyInfo.g.cs", `
"src\NuGet.Jobs.Auxiliary2AzureSearch\Properties\AssemblyInfo.g.cs"
"src\NuGet.Jobs.Auxiliary2AzureSearch\Properties\AssemblyInfo.g.cs", `
"src\NuGet.Jobs.Catalog2Registration\Properties\AssemblyInfo.g.cs", `
"src\NuGet.Jobs.RegistrationComparer\Properties\AssemblyInfo.g.cs"

Foreach ($assemblyInfo in $assemblyInfos) {
Set-VersionInfo -Path (Join-Path $PSScriptRoot $assemblyInfo) -Version $SimpleVersion -Branch $Branch -Commit $CommitSHA
Expand Down Expand Up @@ -138,7 +140,9 @@ Invoke-BuildStep 'Creating artifacts' {
"src\NuGet.Jobs.Db2AzureSearch\NuGet.Jobs.Db2AzureSearch.nuspec", `
"src\NuGet.Jobs.Catalog2AzureSearch\NuGet.Jobs.Catalog2AzureSearch.nuspec", `
"src\NuGet.Jobs.Owners2AzureSearch\NuGet.Jobs.Owners2AzureSearch.nuspec", `
"src\NuGet.Jobs.Auxiliary2AzureSearch\NuGet.Jobs.Auxiliary2AzureSearch.nuspec"
"src\NuGet.Jobs.Auxiliary2AzureSearch\NuGet.Jobs.Auxiliary2AzureSearch.nuspec", `
"src\NuGet.Jobs.Catalog2Registration\NuGet.Jobs.Catalog2Registration.nuspec", `
"src\NuGet.Jobs.RegistrationComparer\NuGet.Jobs.RegistrationComparer.nuspec"

$nuspecPackages | ForEach-Object {
New-Package (Join-Path $PSScriptRoot $_) -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch
Expand Down
6 changes: 6 additions & 0 deletions src/NuGet.Jobs.Catalog2Registration/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\sign.thirdparty.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5ABE8807-2209-4948-9FC5-1980A507C47A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>NuGet.Jobs.Catalog2Registration</RootNamespace>
<AssemblyName>NuGet.Jobs.Catalog2Registration</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\AssemblyInfo.*.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="NuGet.Jobs.Catalog2Registration.nuspec" />
<None Include="Scripts\Functions.ps1" />
<None Include="Scripts\PostDeploy.ps1" />
<None Include="Scripts\PreDeploy.ps1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MicroBuild.Core">
<Version>0.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Catalog\NuGet.Services.Metadata.Catalog.csproj">
<Project>{E97F23B8-ECB0-4AFA-B00C-015C39395FEF}</Project>
<Name>NuGet.Services.Metadata.Catalog</Name>
</ProjectReference>
<ProjectReference Include="..\NuGet.Protocol.Catalog\NuGet.Protocol.Catalog.csproj">
<Project>{D44C2E89-2D98-44BD-8712-8CCBE4E67C9C}</Project>
<Name>NuGet.Protocol.Catalog</Name>
</ProjectReference>
<ProjectReference Include="..\NuGet.Services.V3\NuGet.Services.V3.csproj">
<Project>{c3f9a738-9759-4b2b-a50d-6507b28a659b}</Project>
<Name>NuGet.Services.V3</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\nssm.exe" />
</ItemGroup>
<PropertyGroup>
<SignPath>..\..\build</SignPath>
<SignPath Condition="'$(BUILD_SOURCESDIRECTORY)' != ''">$(BUILD_SOURCESDIRECTORY)\build</SignPath>
<SignPath Condition="'$(NuGetBuildPath)' != ''">$(NuGetBuildPath)</SignPath>
<SignType Condition="'$(SignType)' == ''">none</SignType>
</PropertyGroup>
<Import Project="$(SignPath)\sign.targets" Condition="Exists('$(SignPath)\sign.targets')" />
<Import Project="$(SignPath)\sign.microbuild.targets" Condition="Exists('$(SignPath)\sign.microbuild.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>Catalog2Registration.Rebuild</id>
<version>$version$</version>
<authors>.NET Foundation</authors>
<owners>.NET Foundation</owners>
<description>Catalog2Registration</description>
<copyright>Copyright .NET Foundation</copyright>
</metadata>
<files>
<file src="bin\$configuration$\*.*" target="bin" />
<file src="Scripts\*.ps1" />
<file src="Scripts\nssm.exe" />
</files>
</package>
13 changes: 13 additions & 0 deletions src/NuGet.Jobs.Catalog2Registration/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace NuGet.Jobs.Catalog2Registration
{
class Program
{
static int Main(string[] args)
{
return 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("NuGet.Jobs.Catalog2Registration")]
[assembly: ComVisible(false)]
[assembly: Guid("5abe8807-2209-4948-9fc5-1980a507c47a")]
30 changes: 30 additions & 0 deletions src/NuGet.Jobs.Catalog2Registration/Scripts/Functions.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Function Uninstall-NuGetService() {
Param ([string]$ServiceName)

if (Get-Service $ServiceName -ErrorAction SilentlyContinue)
{
Write-Host Removing service $ServiceName...
Stop-Service $ServiceName -Force
sc.exe delete $ServiceName
Write-Host Removed service $ServiceName.
} else {
Write-Host Skipping removal of service $ServiceName - no such service exists.
}
}

Function Install-NuGetService() {
Param ([string]$ServiceName, [string]$ServiceTitle, [string]$ScriptToRun)

Write-Host Installing service $ServiceName...

$installService = "nssm install $ServiceName $ScriptToRun"
cmd /C $installService

Set-Service -Name $ServiceName -DisplayName "$ServiceTitle - $ServiceName" -Description "Runs $ServiceTitle." -StartupType Automatic
sc.exe failure $ServiceName reset= 30 actions= restart/5000

# Run service
net start $ServiceName

Write-Host Installed service $ServiceName.
}
18 changes: 18 additions & 0 deletions src/NuGet.Jobs.Catalog2Registration/Scripts/PostDeploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
. .\Functions.ps1

$jobsToInstall = $OctopusParameters["Jobs.ServiceNames"].Split("{,}")

Write-Host Installing services...

$currentDirectory = [string](Get-Location)

$jobsToInstall.Split("{;}") | %{
$serviceName = $_
$serviceTitle = $OctopusParameters["Jobs.$serviceName.Title"]
$scriptToRun = $OctopusParameters["Jobs.$serviceName.Script"]
$scriptToRun = "$currentDirectory\$scriptToRun"

Install-NuGetService -ServiceName $serviceName -ServiceTitle $serviceTitle -ScriptToRun $scriptToRun
}

Write-Host Installed services.
11 changes: 11 additions & 0 deletions src/NuGet.Jobs.Catalog2Registration/Scripts/PreDeploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
. .\Functions.ps1

$jobsToInstall = $OctopusParameters["Jobs.ServiceNames"].Split("{,}")

Write-Host Removing services...

$jobsToInstall.Split("{;}") | %{
Uninstall-NuGetService -ServiceName $_
}

Write-Host Removed services.
Binary file not shown.
6 changes: 6 additions & 0 deletions src/NuGet.Jobs.RegistrationComparer/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Loading

0 comments on commit fb5d0f0

Please sign in to comment.