From 10caabe0b1de58537a777b6ac81c2aa32cfdd89c Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Sun, 24 May 2020 20:42:23 +0200 Subject: [PATCH] Update CI and installer --- .promu.yml | 4 ++-- appveyor.yml | 12 +++++----- installer/build.ps1 | 8 +++---- ...{wmi_exporter.wxs => windows_exporter.wxs} | 22 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) rename installer/{wmi_exporter.wxs => windows_exporter.wxs} (65%) diff --git a/.promu.yml b/.promu.yml index 6dde96d1..61a975bb 100644 --- a/.promu.yml +++ b/.promu.yml @@ -1,8 +1,8 @@ repository: - path: github.com/martinlindhe/wmi_exporter + path: github.com/prometheus-community/windows_exporter build: binaries: - - name: wmi_exporter + - name: windows_exporter ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} diff --git a/appveyor.yml b/appveyor.yml index 31ab881b..02d6bee5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ environment: GOPATH: c:\gopath GO111MODULE: on -clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter +clone_folder: c:\gopath\src\github.com\prometheus-community\windows_exporter install: - mkdir %GOPATH%\bin @@ -42,7 +42,7 @@ build_script: make crossbuild # GH requires all files to have different names, so add version/arch to differentiate foreach($Arch in "amd64","386") { - Rename-Item output\$Arch\wmi_exporter.exe -NewName wmi_exporter-$Version-$Arch.exe + Rename-Item output\$Arch\windows_exporter.exe -NewName windows_exporter-$Version-$Arch.exe } after_build: @@ -56,9 +56,9 @@ after_build: # The MSI version is not semver compliant, so just take the numerical parts $MSIVersion = $env:APPVEYOR_REPO_TAG_NAME -replace '^v?([0-9\.]+).*$','$1' foreach($Arch in "amd64","386") { - Write-Verbose "Building wmi_exporter $MSIVersion msi for $Arch" - .\installer\build.ps1 -PathToExecutable .\output\$Arch\wmi_exporter-$BuildVersion-$Arch.exe -Version $MSIVersion -Arch "$Arch" - Move-Item installer\Output\wmi_exporter-$MSIVersion-$Arch.msi output\$Arch\ + Write-Verbose "Building windows_exporter $MSIVersion msi for $Arch" + .\installer\build.ps1 -PathToExecutable .\output\$Arch\windows_exporter-$BuildVersion-$Arch.exe -Version $MSIVersion -Arch "$Arch" + Move-Item installer\Output\windows_exporter-$MSIVersion-$Arch.msi output\$Arch\ } - promu checksum output\ @@ -68,7 +68,7 @@ artifacts: deploy: - provider: GitHub - description: WMI Exporter version $(appveyor_build_version) + description: windows_exporter version $(appveyor_build_version) artifact: Artifacts auth_token: secure: 'CrXWeTf7qONUOEki5olFfGEUPMLDeHj61koDXV3OVEaLgtACmnVHsKUub9POflda' diff --git a/installer/build.ps1 b/installer/build.ps1 index c643d28a..46fb1c17 100644 --- a/installer/build.ps1 +++ b/installer/build.ps1 @@ -48,13 +48,13 @@ Get-FileIfNotExists "https://github.com/wixtoolset/wix3/releases/download/wix311 mkdir -Force WiX | Out-Null Expand-Archive -Path "${sourceDir}\wix-binaries.zip" -DestinationPath WiX -Force -Copy-Item -Force $PathToExecutable Work/wmi_exporter.exe +Copy-Item -Force $PathToExecutable Work/windows_exporter.exe -Write-Verbose "Creating wmi_exporter-${Version}-${Arch}.msi" +Write-Verbose "Creating windows_exporter-${Version}-${Arch}.msi" $wixArch = @{"amd64" = "x64"; "386" = "x86"}[$Arch] $wixOpts = "-ext WixFirewallExtension -ext WixUtilExtension" -Invoke-Expression "WiX\candle.exe -nologo -arch $wixArch $wixOpts -out Work\wmi_exporter.wixobj -dVersion=`"$Version`" wmi_exporter.wxs" -Invoke-Expression "WiX\light.exe -nologo -spdb $wixOpts -out `"Output\wmi_exporter-${Version}-${Arch}.msi`" Work\wmi_exporter.wixobj" +Invoke-Expression "WiX\candle.exe -nologo -arch $wixArch $wixOpts -out Work\windows_exporter.wixobj -dVersion=`"$Version`" windows_exporter.wxs" +Invoke-Expression "WiX\light.exe -nologo -spdb $wixOpts -out `"Output\windows_exporter-${Version}-${Arch}.msi`" Work\windows_exporter.wixobj" Write-Verbose "Done!" Pop-Location diff --git a/installer/wmi_exporter.wxs b/installer/windows_exporter.wxs similarity index 65% rename from installer/wmi_exporter.wxs rename to installer/windows_exporter.wxs index e84427ee..f880baf3 100644 --- a/installer/wmi_exporter.wxs +++ b/installer/windows_exporter.wxs @@ -8,12 +8,12 @@ - - - + + @@ -31,7 +31,7 @@ - + @@ -42,14 +42,14 @@ - - + + - + - - + +