aboutsummaryrefslogtreecommitdiff
path: root/box.rb
blob: f386ae6d50a1265796036911b75ffb3d7508ab66 (plain)
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
from "xena/go-mini:1.9.2"

### setup go
run "go1.9.2 download"

### Copy files
run "mkdir -p /site"

def debug?()
  getenv("DEBUG") == "yes"
end

def debug!()
  run "apk add --no-cache bash"
  debug
end

def put(file)
  copy "./#{file}", "/site/#{file}"
end

files = [
  "blog",
  "templates",
  "gops.go",
  "hash.go",
  "html.go",
  "main.go",
  "rice-box.go",
  "rss.go",
  "run.sh"
]

files.each { |x| put x }

copy "vendor/", "/root/go/src/"

### Build
run "cd /site && go1.9.2 build -v"

### Cleanup
run %q[ rm -rf /root/go /site/backend /root/sdk /site/*.go ]
run %q[ apk del go1.9.2 ]

cmd "/site/run.sh"

flatten
tag "xena/christine.website"