2017-12-11 06:16:23 +00:00
|
|
|
from "xena/go-mini:1.9.2"
|
2017-05-20 22:56:34 +00:00
|
|
|
|
|
|
|
### setup go
|
2017-12-11 06:16:23 +00:00
|
|
|
run "go1.9.2 download"
|
2017-05-20 22:56:34 +00:00
|
|
|
|
|
|
|
### 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",
|
2017-05-23 19:47:17 +00:00
|
|
|
"run.sh"
|
2017-05-20 22:56:34 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
files.each { |x| put x }
|
|
|
|
|
|
|
|
copy "vendor/", "/root/go/src/"
|
|
|
|
|
|
|
|
### Build
|
2017-12-11 06:16:23 +00:00
|
|
|
run "cd /site && go1.9.2 build -v"
|
2017-05-20 22:56:34 +00:00
|
|
|
|
|
|
|
### Cleanup
|
|
|
|
run %q[ rm -rf /root/go /site/backend /root/sdk /site/*.go ]
|
2017-12-11 06:24:31 +00:00
|
|
|
run %q[ apk del go1.9.2 ]
|
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"
|