aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2017-01-10 12:39:41 -0800
committerChristine Dodrill <me@christine.website>2017-01-10 12:39:41 -0800
commit13b5a38637976b7d00f7dd79f87e4403ea72765e (patch)
treed1c559a28b8bd5ec44d4a1d8adee33cd324dbd92
parent8fe2cfd62306449cc1962a36b7f4462b3de6de0a (diff)
downloadxesite-13b5a38637976b7d00f7dd79f87e4403ea72765e.tar.xz
xesite-13b5a38637976b7d00f7dd79f87e4403ea72765e.zip
box: put vendored code directly in /go/src
-rw-r--r--box.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/box.rb b/box.rb
index ae5516b..2756dc4 100644
--- a/box.rb
+++ b/box.rb
@@ -3,6 +3,18 @@ from "xena/go:1.7.4"
### Copy files
run "mkdir -p /site"
+def debug?()
+ return getenv("DEBUG") == "yes"
+end
+
+def debug!()
+ run "apk add --no-cache bash"
+ debug
+ run "apk del bash"
+
+ puts "hint: flatten this image if deploying."
+end
+
def put(file)
copy "./#{file}", "/site/#{file}"
end
@@ -22,12 +34,15 @@ files = [
files.each { |x| put x }
+copy "vendor/", "/go/"
+run "rm /go/src -rf && mv /go/vendor /go/src"
+
### Build
-run "apk add --no-cache git"
run %q[ cd /site && sh ./build.sh ]
+debug! if debug?
### Cleanup
-run %q[ rm -rf /usr/local/go /usr/local/node /site/frontend/node_modules /site/frontend/bower_components /go /site/backend /tmp/phantomjs ]
+run %q[ rm -rf /usr/local/go /go /site/backend ]
run %q[ apk del go git ]
### Runtime