This repository was archived by the owner on Sep 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbox.rb
61 lines (47 loc) · 1.44 KB
/
box.rb
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
from "debian"
after do
tag "boxbuilder/box:master"
save file: "box-builder.oci.tar", kind: :oci
end
DOCKER_VERSION = "1.13.1"
GOLANG_VERSION = "1.9.2"
PACKAGES = %w[
build-essential
g++
git
wget
curl
ruby
bison
flex
iptables
psmisc
python2.7
]
qq = getenv("CI_BUILD") != "" ? "-qq" : ""
skip do
workdir "/"
run "apt-get update #{qq}"
run "apt-get install -y #{qq} #{PACKAGES.join(" ")}"
docker_path = "docker-#{DOCKER_VERSION}.tgz"
run "wget -q https://get.docker.com/builds/Linux/x86_64/#{docker_path}"
run "tar -xpf #{docker_path} --strip-components=1 -C /usr/bin/"
run "rm #{docker_path}"
run "curl -sSL https://storage.googleapis.com/golang/go#{GOLANG_VERSION}.linux-amd64.tar.gz | tar -xz -C /usr/local"
copy "dind", "/dind"
run "curl -sSL https://bootstrap.pypa.io/get-pip.py | python2.7"
run "pip -q install mkdocs mkdocs-bootswatch"
env "PATH" => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/go/bin:/go/bin", "GOPATH" => "/go"
copy ".", "/go/src/github.com/box-builder/box", ignore_file: ".boxignore"
run "cd /go/src/github.com/box-builder/box && VERSION=#{getenv("VERSION")} make clean install"
workdir "/go/src/github.com/box-builder/box"
set_exec entrypoint: ["/dind"], cmd: %w[make docker-test]
sum = getenv("SUM")
if sum != ""
sum = "-#{sum}"
end
tag "box-test#{sum}"
end
run "mv /go/bin/box /box"
workdir "/"
set_exec entrypoint: ["/box"], cmd: []