site/box.rb

40 lines
558 B
Ruby
Raw Normal View History

2018-02-09 06:51:17 +00:00
from "xena/go-mini:1.9.4"
2017-05-20 22:56:34 +00:00
### setup go
2018-02-09 06:51:17 +00:00
run "go1.9.4 download"
2017-05-20 22:56:34 +00:00
### Copy files
run "mkdir -p /site"
def put(file)
copy "./#{file}", "/site/#{file}"
end
files = [
"gops.go",
"hash.go",
"html.go",
"main.go",
"rss.go",
2017-12-13 19:42:17 +00:00
"run.sh",
"templates",
"blog",
"rice-box.go"
2017-05-20 22:56:34 +00:00
]
files.each { |x| put x }
copy "vendor/", "/root/go/src/"
### Build
2018-02-09 06:51:17 +00:00
run "cd /site && go1.9.4 build -v"
2017-05-20 22:56:34 +00:00
### Cleanup
run %q[ rm -rf /root/go /site/backend /root/sdk /site/*.go ]
2018-02-09 06:51:17 +00:00
run %q[ rm -rf /usr/local/bin/go* ]
2017-05-20 22:56:34 +00:00
2017-05-23 19:47:17 +00:00
cmd "/site/run.sh"
2017-05-20 22:56:34 +00:00
flatten
tag "xena/christine.website"