Skip to content

Commit

Permalink
Merge pull request #52 from newrelic/feature/windows-build
Browse files Browse the repository at this point in the history
Feature/windows build
  • Loading branch information
camdencheek authored Aug 12, 2019
2 parents 7dc3e03 + 1abffbd commit 8da090e
Show file tree
Hide file tree
Showing 10 changed files with 525 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.1.0 - 2019-06-19
### Added
- Windows build

## 4.0.2 - 2019-06-19
### Fixed
- Misspelling "Dcoument" and "Aueue"
Expand Down
17 changes: 17 additions & 0 deletions elasticsearch-win-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: com.newrelic.elasticsearch
description: Reports status and metrics for elasticsearch service
protocol_version: 2
os: windows

commands:
all:
command:
- .\bin\nr-elasticsearch.exe
prefix: config/elasticsearch
interval: 15
inventory:
command:
- .\bin\nr-elasticsearch.exe
- --inventory
prefix: config/elasticsearch
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 = "{f42aa489-e590-429d-a1c2-4ebd97cf8c3e}" ?>

<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="c57aeed1-f045-4202-8daa-d806db2e29e4" 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="35c84fd9-7b1a-4871-a706-390ea19252b1" 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="ae131e4c-7ec5-42c5-b21b-b454979f28ee" 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>89a5d3bd-73d7-4ebb-8f3c-75a7c09e67a4</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 = "{f42aa489-e590-429d-a1c2-4ebd97cf8c3e}" ?>

<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="eea30c6e-7a14-4cc5-97c5-88a742041643" 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="35c84fd9-7b1a-4871-a706-390ea19252b1" 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="ae131e4c-7ec5-42c5-b21b-b454979f28ee" 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>
3 changes: 2 additions & 1 deletion src/elasticsearch.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:generate goversioninfo
package main

import (
Expand Down Expand Up @@ -28,7 +29,7 @@ type argumentList struct {

const (
integrationName = "com.newrelic.elasticsearch"
integrationVersion = "4.0.2"
integrationVersion = "4.1.0"
)

var (
Expand Down
44 changes: 44 additions & 0 deletions src/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 8da090e

Please sign in to comment.