Skip to content

Commit

Permalink
Add windows build files
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed Nov 12, 2019
1 parent 6460197 commit 234c4d0
Show file tree
Hide file tree
Showing 9 changed files with 530 additions and 0 deletions.
27 changes: 27 additions & 0 deletions kafka-win-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: com.newrelic.kafka
description: Reports status and metrics for Kafka services
protocol_version: 2
os: windows

commands:
metrics:
command:
- .\bin\nr-kafka.exe
- --metrics
interval: 15

inventory:
command:
- .\bin\nr-kafka.exe
- --inventory
prefix: config/kafka
interval: 15

consumer_offset:
command:
- .\bin\nr-kafka.exe
- --consumer_offset
- --inventory=false
- --metrics=false
prefix: config/kafka
interval: 15
96 changes: 96 additions & 0 deletions pkg/windows/nri-386-installer/Product.wxs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Version = "{IntegrationVersion}" ?>
<?define ProductId = "*" ?>
<?define UpgradeCode = "{a592ff01-8b28-4a35-9e3b-19c30164794e}" ?>

<Product Id="$(var.ProductId)"
Name="New Relic Infrastructure Integration, nri-{IntegrationName}"
Language="1033"
Version="$(var.Version)"
Manufacturer="New Relic, Inc."
UpgradeCode="$(var.UpgradeCode)">
<Package Id="*"
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Platform="x86"
Manufacturer="New Relic, Inc."
Comments="(c) {Year} New Relic, Inc."
Keywords="infrastructure,MSI,on-host,{IntegrationName}"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="New Relic Infrastructure Integration, nri-{IntegrationName}" Level="1">
<ComponentRef Id="CMP_V1_PLUGIN_CONFIGS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS_BIN"/>
<ComponentGroupRef Id="CustomPluginsBinComponent"/>
<ComponentGroupRef Id="CustomPluginsComponent"/>
<ComponentGroupRef Id="PluginConfigsComponent"/>
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="CompanyFolder" Name="New Relic">
<Directory Id="AgentBinaryFolder" Name="newrelic-infra">
<Directory Id="PluginConfigsFolder" Name="integrations.d"/>
<Directory Id="CustomPluginsFolder" Name="newrelic-integrations">
<Directory Id="CustomPluginsBinFolder" Name="bin"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<DirectoryRef Id="PluginConfigsFolder">
<Component Id="CMP_V1_PLUGIN_CONFIGS" Guid="803C978C-B2A1-47C7-BB17-A2DE9E6D3145" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS" Guid="0EE4AAF4-9923-499C-A1D0-FF55B205A76C" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsBinFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS_BIN" Guid="e4509a7a-409e-4a38-8705-37de9cf0d72d" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<ComponentGroup Id="CustomPluginsBinComponent" Directory="CustomPluginsBinFolder">
<Component Id="CMP_NRI_{IntegrationName}_EXE" Guid="615d1eff-9a67-4386-b47d-836cbb7fa87f" Win64="no">
<File Id="FILE_NRI_{IntegrationName}_EXE"
Source="$(var.BinariesPath){IntegrationExe}"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="CustomPluginsComponent" Directory="CustomPluginsFolder">
<Component Id="CMP_NRI_{IntegrationName}_DEFINITION_YML" Guid="c8d36adc-419f-45a7-9f3c-997b18e09155" Win64="no"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_DEFINITION_YML"
Name="{IntegrationName}-definition.yml"
Source="$(var.ProjectRootPath){IntegrationName}-win-definition.yml"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="PluginConfigsComponent" Directory="PluginConfigsFolder">
<Component Id="CMP_NRI_{IntegrationName}_CONFIG_YML" Guid="5aedd0b1-e05d-4f8d-aa65-0683fd01b3d6" Win64="no"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_CONFIG_YML"
Name="{IntegrationName}-config.yml.sample"
Source="$(var.ProjectRootPath){IntegrationName}-config.yml.sample"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>

</Wix>
41 changes: 41 additions & 0 deletions pkg/windows/nri-386-installer/nri-installer.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>101f30ba-6098-4ef0-8b8f-0636298997c6</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>$(integration)-386</OutputName>
<OutputType>Package</OutputType>
<SignToolPath>C:\Program Files (x86)\Windows Kits\10\bin\x64\</SignToolPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>newrelic-$(integration)-installer</Name>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_386\</DefineConstants>
<SuppressAllWarnings>True</SuppressAllWarnings>
<Pedantic>False</Pedantic>
<CompilerAdditionalOptions>-arch x86</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_386\</DefineConstants>
<CompilerAdditionalOptions>-arch x86</CompilerAdditionalOptions>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs"/>
</ItemGroup>
<Import Project="$(WixTargetsPath)"/>
<Target Name="SignInstaller">
<Exec Command="&quot;$(SignToolPath)signtool.exe&quot; sign /d &quot;New Relic Infrastructure Integration, $(integration)&quot; /a &quot;$(OutputPath)$(OutputName).msi&quot;"/>
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(OutputPath)$(OutputName).x.y.z.msi"/>
<!-- <Delete Files="$(OutputPath)$(OutputName).msi" /> -->
</Target>
<Target Name="AfterBuild" DependsOnTargets="SignInstaller"/>
</Project>
96 changes: 96 additions & 0 deletions pkg/windows/nri-amd64-installer/Product.wxs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define Version = "{IntegrationVersion}" ?>
<?define ProductId = "*" ?>
<?define UpgradeCode = "{a592ff01-8b28-4a35-9e3b-19c30164794e}" ?>

<Product Id="$(var.ProductId)"
Name="New Relic Infrastructure Integration, nri-{IntegrationName}"
Language="1033"
Version="$(var.Version)"
Manufacturer="New Relic, Inc."
UpgradeCode="$(var.UpgradeCode)">
<Package Id="*"
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Platform="x64"
Manufacturer="New Relic, Inc."
Comments="(c) {Year} New Relic, Inc."
Keywords="infrastructure,MSI,on-host,{IntegrationName}"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="New Relic Infrastructure Integration, nri-{IntegrationName}" Level="1">
<ComponentRef Id="CMP_V1_PLUGIN_CONFIGS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS"/>
<ComponentRef Id="CMP_V1_CUSTOM_PLUGINS_BIN"/>
<ComponentGroupRef Id="CustomPluginsBinComponent"/>
<ComponentGroupRef Id="CustomPluginsComponent"/>
<ComponentGroupRef Id="PluginConfigsComponent"/>
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CompanyFolder" Name="New Relic">
<Directory Id="AgentBinaryFolder" Name="newrelic-infra">
<Directory Id="PluginConfigsFolder" Name="integrations.d"/>
<Directory Id="CustomPluginsFolder" Name="newrelic-integrations">
<Directory Id="CustomPluginsBinFolder" Name="bin"/>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<DirectoryRef Id="PluginConfigsFolder">
<Component Id="CMP_V1_PLUGIN_CONFIGS" Guid="803C978C-B2A1-47C7-BB17-A2DE9E6D3145" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS" Guid="0EE4AAF4-9923-499C-A1D0-FF55B205A76C" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
<DirectoryRef Id="CustomPluginsBinFolder">
<Component Id="CMP_V1_CUSTOM_PLUGINS_BIN" Guid="e4509a7a-409e-4a38-8705-37de9cf0d72d" KeyPath="yes">
<CreateFolder/>
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<ComponentGroup Id="CustomPluginsBinComponent" Directory="CustomPluginsBinFolder">
<Component Id="CMP_NRI_{IntegrationName}_EXE" Guid="615d1eff-9a67-4386-b47d-836cbb7fa87f" Win64="yes">
<File Id="FILE_NRI_{IntegrationName}_EXE"
Source="$(var.BinariesPath){IntegrationExe}"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="CustomPluginsComponent" Directory="CustomPluginsFolder">
<Component Id="CMP_NRI_{IntegrationName}_DEFINITION_YML" Guid="c8d36adc-419f-45a7-9f3c-997b18e09155" Win64="yes"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_DEFINITION_YML"
Name="{IntegrationName}-definition.yml"
Source="$(var.ProjectRootPath){IntegrationName}-win-definition.yml"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="PluginConfigsComponent" Directory="PluginConfigsFolder">
<Component Id="CMP_NRI_{IntegrationName}_CONFIG_YML" Guid="5aedd0b1-e05d-4f8d-aa65-0683fd01b3d6" Win64="yes"
NeverOverwrite="yes" Permanent="yes">
<File Id="FILE_NRI_{IntegrationName}_CONFIG_YML"
Name="{IntegrationName}-config.yml.sample"
Source="$(var.ProjectRootPath){IntegrationName}-config.yml.sample"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>

</Wix>
41 changes: 41 additions & 0 deletions pkg/windows/nri-amd64-installer/nri-installer.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>89a5d3bd-73d7-4ebb-8f3c-75a7c09e67a4</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>$(integration)-amd64</OutputName>
<OutputType>Package</OutputType>
<SignToolPath>C:\Program Files (x86)\Windows Kits\10\bin\x64\</SignToolPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>newrelic-$(integration)-installer</Name>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_amd64\</DefineConstants>
<SuppressAllWarnings>True</SuppressAllWarnings>
<Pedantic>False</Pedantic>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProjectRootPath=..\..\..\;BinariesPath=..\..\..\target\bin\windows_amd64\</DefineConstants>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs"/>
</ItemGroup>
<Import Project="$(WixTargetsPath)"/>
<Target Name="SignInstaller">
<Exec Command="&quot;$(SignToolPath)signtool.exe&quot; sign /d &quot;New Relic Infrastructure Integration, $(integration)&quot; /a &quot;$(OutputPath)$(OutputName).msi&quot;"/>
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="$(OutputPath)$(OutputName).x.y.z.msi"/>
<!-- <Delete Files="$(OutputPath)$(OutputName).msi" /> -->
</Target>
<Target Name="AfterBuild" DependsOnTargets="SignInstaller"/>
</Project>
1 change: 1 addition & 0 deletions src/kafka.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:generate goversioninfo
package main

import (
Expand Down
44 changes: 44 additions & 0 deletions versioninfo.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"FixedFileInfo":
{
"FileVersion": {
"Major": {MajorVersion},
"Minor": {MinorVersion},
"Patch": {PatchVersion},
"Build": {BuildVersion}
},
"ProductVersion": {
"Major": {MajorVersion},
"Minor": {MinorVersion},
"Patch": {PatchVersion},
"Build": {BuildVersion}
},
"FileFlagsMask": "3f",
"FileFlags ": "00",
"FileOS": "040004",
"FileType": "01",
"FileSubType": "00"
},
"StringFileInfo":
{
"Comments": "(c) {Year} New Relic, Inc.",
"CompanyName": "New Relic, Inc.",
"FileDescription": "",
"FileVersion": "{MajorVersion}.{MinorVersion}.{PatchVersion}.{BuildVersion}",
"InternalName": "{Integration}",
"LegalCopyright": "(c) {Year} New Relic, Inc.",
"LegalTrademarks": "",
"OriginalFilename": "{IntegrationExe}",
"PrivateBuild": "",
"ProductName": "New Relic Infrastructure Integration, {Integration}",
"ProductVersion": "{MajorVersion}.{MinorVersion}.{PatchVersion}.{BuildVersion}",
"SpecialBuild": ""
},
"VarFileInfo":
{
"Translation": {
"LangID": "0409",
"CharsetID": "04B0"
}
}
}
Loading

0 comments on commit 234c4d0

Please sign in to comment.