This repository has been archived by the owner on Feb 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
62 lines (52 loc) · 1.47 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
task :default => [:test]
desc "Run just tests no measurements"
task :test do
sh "ginkgo -r -skipMeasurements ."
end
desc "Run tests including measure tests"
task :test_and_measure do
sh "ginkgo -r ."
end
desc "Builds packages"
task :build do
version = ENV["VERSION"] || "0.0.0"
sha = `git rev-parse --short HEAD`.chomp
build = ENV["BUILD"] || "foss"
packages = (ENV["PACKAGES"] || "").split(",")
packages = ["el7_64", "el6_64", "el6_32", "puppet"] if packages.empty?
source = "/go/src/github.com/choria-io/prometheus-streams"
packages.each do |pkg|
if pkg =~ /^(.+?)_(.+)$/
builder = "choria/packager:%s-go1.11" % $1
elsif pkg == "puppet"
builder = "choria/packager:el7-go1.11-puppet"
else
builder = "choria/packager:el7-go1.11"
end
sh 'docker run --rm -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e PACKAGE=%s %s' % [
source,
source,
source,
sha,
build,
version,
pkg,
builder
]
end
end
desc "Builds binaries"
task :build_binaries do
version = ENV["VERSION"] || "0.0.0"
sha = `git rev-parse --short HEAD`.chomp
build = ENV["BUILD"] || "foss"
source = "/go/src/github.com/choria-io/prometheus-streams"
sh 'docker run --rm -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e BINARY_ONLY=1 choria/packager:el7-go1.11' % [
source,
source,
source,
sha,
build,
version
]
end