Skip to content

Commit

Permalink
Add script that compiles releases
Browse files Browse the repository at this point in the history
  • Loading branch information
knes1 committed Feb 5, 2016
1 parent b7049a4 commit 2f20018
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ target
*.iml
bin/
vendor/
release/
release.sh
26 changes: 26 additions & 0 deletions build-release.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Ruby script that builds binaries for 64bit windows, osx and linux
builds = [
["darwin", "amd64", "zip", "_osx"],
["linux", "amd64", "tar.gz", "_linux_amd64"],
["windows", "amd64", "zip", "_win"]
]
Dir.mkdir("release") unless Dir.exist?("release")
builds.each {|info|
os = info[0]
arch = info[1]
buildCmd = "GOOS=#{os} GOARCH=#{arch} go build"
ext = (os == "windows")? ".exe" : ""
tag = info[3]
deployCmd = ""
if (info[2] == "zip")
zipFile = "elktail#{tag}.zip"
deployCmd = "zip release/#{zipFile} elktail#{ext}"
else
zipFile = "elktail#{tag}.tar.gz"
deployCmd = "tar cvzf release/#{zipFile} elktail#{ext}"
end
puts "Building: " + buildCmd
puts system(buildCmd)
puts "Deploying: " + deployCmd
puts system(deployCmd)
}

0 comments on commit 2f20018

Please sign in to comment.