This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the initial Catalog2Registration projects (#705)
Address NuGet/NuGetGallery#7735
- Loading branch information
1 parent
ac7c8f7
commit fb5d0f0
Showing
23 changed files
with
539 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
92 changes: 92 additions & 0 deletions
92
src/NuGet.Jobs.Catalog2Registration/NuGet.Jobs.Catalog2Registration.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
16 changes: 16 additions & 0 deletions
16
src/NuGet.Jobs.Catalog2Registration/NuGet.Jobs.Catalog2Registration.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/NuGet.Jobs.Catalog2Registration/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
src/NuGet.Jobs.Catalog2Registration/Scripts/PostDeploy.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.