-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builds deb, rpm, msi and chocolatey packages #675
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
25ef865
Building deb, rpm, msi and chocolatey packages
luizbafilho e947c18
Moving build-linux-packages dockerfile to packaging dir
luizbafilho ef5aea5
Changing debian changelog command
luizbafilho a8ee1cb
Adding license to MSI
luizbafilho 6f672e5
Changing appveyor build command
luizbafilho a322442
Fixing appveyor build command
luizbafilho 9da116b
Fixing publish msi order
luizbafilho 625c138
Enabling specific build for only vX.X.X tags on windows
luizbafilho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,50 @@ | ||
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 | ||
BINTRAY_KEY: | ||
secure: /0S6SdBwfiuWEdY4SKJcZpxEV+QpsfJfqx3QqYbnK8vwmB2KMGqerGzQRnIrkbGD | ||
GPG_PASSPHRASE: | ||
secure: CMQ+U+qVVdhIr1Eip5nGPbaGFggVvSjg/BpSY0EpLbQ= | ||
|
||
# prepare system and project | ||
install: | ||
- choco install wixtoolset -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: | ||
- CGO_ENABLED=0 GOARCH=amd64 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: | ||
- 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 | ||
|
||
# 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"' | ||
# 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": "cat './release notes/v0.21.0.md'", | ||
"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,46 @@ | ||
<?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"/> | ||
</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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? We'd have to change it for every release and I'm not sure how pretty the markdown file intended for github would be when you use it as a deb changelog. Also, if I remember correctly, debian changelogs included the full history of the package, not just the changes in the latest release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw the command in the
rpm.json
spec, that one looks much more maintainableThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed the
version
variable, I'll added it