-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Builds deb, rpm, msi and chocolatey packages (#675)
* Building deb, rpm, msi and chocolatey packages
- Loading branch information
1 parent
5ee8e9b
commit f85389f
Showing
13 changed files
with
303 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
/dist | ||
/js/node_modules | ||
/docs | ||
/pkg-build | ||
|
||
/debug | ||
test.debug | ||
|
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,52 @@ | ||
image: Visual Studio 2017 | ||
clone_folder: 'c:\gopath\src\github.com\%APPVEYOR_REPO_NAME%' | ||
|
||
branches: | ||
only: | ||
- /^v\d+\.\d+\.\d+$/ | ||
|
||
environment: | ||
# improve readability | ||
VCS_URL: 'https://github.com/%APPVEYOR_REPO_NAME%' | ||
# specific to go | ||
VERSION: "%APPVEYOR_REPO_TAG_NAME:v=%" | ||
GOPATH: c:\gopath | ||
CGO_ENABLED: '0' | ||
GOARCH: amd64 | ||
BINTRAY_KEY: | ||
secure: /0S6SdBwfiuWEdY4SKJcZpxEV+QpsfJfqx3QqYbnK8vwmB2KMGqerGzQRnIrkbGD | ||
GPG_PASSPHRASE: | ||
secure: CMQ+U+qVVdhIr1Eip5nGPbaGFggVvSjg/BpSY0EpLbQ= | ||
|
||
# prepare system and project | ||
install: | ||
- choco install wixtoolset pandoc -y | ||
- refreshenv | ||
# ensure wix is available in PATH | ||
- set PATH=%WIX%\bin;%PATH% | ||
# specific to go | ||
- set PATH=%GOPATH%\bin;%PATH% | ||
|
||
# build msi artifacts | ||
build_script: | ||
- pandoc -s -f markdown -t rtf -o packaging\LICENSE.rtf LICENSE.md | ||
- go build -a -ldflags "-s -w" -o packaging\k6.exe | ||
- cd packaging | ||
- candle.exe -arch x64 -dVERSION=%VERSION% k6.wxs | ||
- light.exe -ext WixUIExtension k6.wixobj | ||
|
||
deploy_script: | ||
# Publishing the msi | ||
- 'curl -H "X-GPG-PASSPHRASE: %GPG_PASSPHRASE%" -T k6.msi "https://%BINTRAY_USER%:%BINTRAY_KEY%@api.bintray.com/content/loadimpact/windows/k6/%VERSION%/k6-v%VERSION%-amd64.msi?publish=1&override=1"' | ||
- ps: | | ||
# Create Chocolately Package | ||
mkdir .\k6.portable | ||
Copy-Item -Path .\k6.portable.nuspec -Destination .\k6.portable\k6.portable.nuspec | ||
Copy-Item -Path .\k6.exe -Destination .\k6.portable\k6.exe | ||
Set-Location -Path .\k6.portable\ | ||
(Get-Content '.\k6.portable.nuspec' -Raw).Replace("<version>__REPLACE__</version>", "<version>$($env:VERSION)</version>") | Out-File '.\k6.portable.nuspec' | ||
choco pack | ||
# Publising the chocolatey package | ||
- 'curl -H "X-GPG-PASSPHRASE: %GPG_PASSPHRASE%" -T .\k6.portable.%VERSION%.nupkg "https://%BINTRAY_USER%:%BINTRAY_KEY%@api.bintray.com/content/loadimpact/choco/k6.portable/%VERSION%/k6.portable.%VERSION%.nupkg?publish=1&override=1"' |
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,17 @@ | ||
FROM golang:1.10.2-stretch | ||
|
||
RUN curl https://glide.sh/get | sh | ||
|
||
WORKDIR /go/src/github.com/loadimpact/k6 | ||
|
||
RUN go get github.com/mh-cbon/go-bin-deb \ | ||
&& cd /go/src/github.com/mh-cbon/go-bin-deb \ | ||
&& glide install \ | ||
&& go install | ||
|
||
RUN go get github.com/mh-cbon/go-bin-rpm \ | ||
&& cd /go/src/github.com/mh-cbon/go-bin-rpm \ | ||
&& glide install \ | ||
&& go install | ||
|
||
RUN apt-get update -y && apt-get install -y fakeroot rpm |
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,23 @@ | ||
{ | ||
"name": "k6", | ||
"maintainer": "Load Impact AB", | ||
"description": "Load testing for the 21st century", | ||
"changelog-cmd": "echo \"* $(date \"+%a %b %d %Y\") Load Impact \n - Go to the release page for more details on the changelog.\n\n https://github.com/loadimpact/k6/releases/tag/v!version!\"", | ||
"homepage": "https://k6.io/", | ||
"files": [ | ||
{ | ||
"from": "/tmp/!name!", | ||
"to": "/usr/bin/", | ||
"base" : "/tmp", | ||
"fperm": "0755" | ||
} | ||
], | ||
"copyrights": [ | ||
{ | ||
"files": "*", | ||
"copyright": "2018 Load Impact AB", | ||
"license": "AGPL-3.0", | ||
"file": "LICENSE" | ||
} | ||
] | ||
} |
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,12 @@ | ||
version: '3' | ||
services: | ||
build-linux-packages: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.linux | ||
command: | | ||
bash -c " | ||
CGO_ENABLED=0 GOARCH=amd64 go build -a -ldflags '-s -w' -o /tmp/k6 | ||
/go/src/github.com/loadimpact/k6/packaging/gen-packages.sh" | ||
volumes: | ||
- ..:/go/src/github.com/loadimpact/k6 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ -z "${VERSION}" ]]; then | ||
echo "\$VERSION enviroment variable undefined" | ||
exit 2 | ||
fi | ||
|
||
rm -rf pkg-build | ||
|
||
mkdir -p dist | ||
go-bin-deb generate --file packaging/deb.json -a amd64 --version $VERSION -o dist/k6-v$VERSION-amd64.deb | ||
go-bin-rpm generate --file packaging/rpm.json -a amd64 --version $VERSION -o dist/k6-v$VERSION-amd64.rpm |
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,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>k6.portable</id> | ||
<title>k6 (Portable)</title> | ||
<version>__REPLACE__</version> | ||
<authors>Load Impact</authors> | ||
<owners>Load Impact</owners> | ||
<summary>Load testing for the 21st century</summary> | ||
<description> | ||
k6 is a developer centric open source load testing tool for testing the performance of your backend infrastructure. It’s built with Go and JavaScript to integrate well into your development workflow, so you can stay on top of performance without fuzz. | ||
</description> | ||
<projectUrl>https://k6.io</projectUrl> | ||
<packageSourceUrl>https://github.com/loadimpact/k6</packageSourceUrl> | ||
<projectSourceUrl>https://github.com/loadimpact/k6</projectSourceUrl> | ||
<tags></tags> | ||
<copyright></copyright> | ||
<licenseUrl>https://github.com/loadimpact/k6/blob/master/LICENSE.md</licenseUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
</metadata> | ||
</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,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | ||
<Product Id="*" UpgradeCode="8C5F9495-F697-4780-ABFD-90DCC2F681B6" Version="$(var.VERSION)" Language="1033" Name="k6" Manufacturer="Load Impact AB"> | ||
<Package InstallerVersion="300" Compressed="yes"/> | ||
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/> | ||
|
||
<Icon Id="k6Icon" SourceFile="k6.ico"/> | ||
<Property Id="ARPPRODUCTICON" Value="k6Icon"/> | ||
|
||
<Media Id="1" Cabinet="k6.cab" EmbedCab="yes" /> | ||
|
||
<!-- Step 1: Define the directory structure --> | ||
<Directory Id="TARGETDIR" Name="SourceDir"> | ||
<Directory Id="ProgramFiles64Folder"> | ||
<Directory Id="INSTALLDIR" Name="k6"/> | ||
</Directory> | ||
</Directory> | ||
|
||
<!-- Step 2: Add files to your installer package --> | ||
<DirectoryRef Id="INSTALLDIR"> | ||
<Component Id="k6.exe" Guid="*"> | ||
<File Id="k6.exe" Source="k6.exe" KeyPath="yes" /> | ||
</Component> | ||
<Component Id="PathEnv" Guid="2DFDBB7D-292E-462c-A3E3-2FA14FFCD05D" > | ||
<Environment Id="Path" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" Separator=";" /> | ||
<CreateFolder /> | ||
</Component> | ||
</DirectoryRef> | ||
|
||
<!-- Step 3: Tell WiX to install the files --> | ||
<Feature Id="MainApplication" Title="Main Application" Level="1"> | ||
<ComponentRef Id="k6.exe" /> | ||
<ComponentRef Id="PathEnv" /> | ||
</Feature> | ||
|
||
<UI Id="k6InstallUI"> | ||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> | ||
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="k6 has been successfully installed." /> | ||
</UI> | ||
|
||
<UIRef Id="WixUI_InstallDir" /> | ||
<UIRef Id="WixUI_ErrorProgressText" /> | ||
<WixVariable Id="WixUIBannerBmp" Value="thin-white-stripe.jpg"/> | ||
<WixVariable Id="WixUIDialogBmp" Value="full-white-stripe.jpg"/> | ||
<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf"/> | ||
</Product> | ||
</Wix> |
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,17 @@ | ||
{ | ||
"name": "k6", | ||
"Summary": "Load testing for the 21st century", | ||
"description": "k6 is a developer centric open source load testing tool for testing the performance of your backend infrastructure. It’s built with Go and JavaScript to integrate well into your development workflow, so you can stay on top of performance without fuzz.", | ||
"changelog-cmd": "echo \"* $(date \"+%a %b %d %Y\") Load Impact \n - Go to the release page for more details on the changelog.\n\n https://github.com/loadimpact/k6/releases/tag/v!version!\"", | ||
"license": "LICENSE", | ||
"version": "!version!", | ||
"arch": "!arch!", | ||
"url": "https://k6.io/", | ||
"files": [ | ||
{ | ||
"from": "/tmp/!name!", | ||
"to": "%{_bindir}/", | ||
"base": "/tmp" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.