From 13b5a38637976b7d00f7dd79f87e4403ea72765e Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Tue, 10 Jan 2017 12:39:41 -0800 Subject: [PATCH] box: put vendored code directly in /go/src --- box.rb | 19 +++++++++++++++++-- 1 file 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