wrapper scripts for launching
This commit is contained in:
parent
6171da53db
commit
8d5fcbee7f
|
@ -1,5 +1,6 @@
|
||||||
FROM gliderlabs/alpine
|
FROM gliderlabs/alpine
|
||||||
|
|
||||||
ADD build_image/discourse-auth-proxy /bin/discourse-auth-proxy
|
ADD build_image/discourse-auth-proxy /bin/discourse-auth-proxy
|
||||||
|
ADD start.sh /bin/start.sh
|
||||||
|
|
||||||
CMD ["/bin/discourse-auth-proxy"]
|
CMD ["/bin/start.sh"]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
require 'pty'
|
require 'pty'
|
||||||
|
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
$nocache = false
|
||||||
|
|
||||||
def run(command)
|
def run(command)
|
||||||
lines = []
|
lines = []
|
||||||
|
@ -20,7 +21,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
def build(path)
|
def build(path)
|
||||||
lines = run("cd #{path} && docker build --no-cache .")
|
lines = run("cd #{path} && docker build #{$nocache ? "--no-cache" : ""} .")
|
||||||
lines[-1]["successfully built ".length..-1].strip
|
lines[-1]["successfully built ".length..-1].strip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ tag = "#{repo}:#{version}"
|
||||||
latest = "#{repo}:#{latest}"
|
latest = "#{repo}:#{latest}"
|
||||||
|
|
||||||
img = build(".")
|
img = build(".")
|
||||||
run "docker tag #{img} #{tag}"
|
run "docker tag -f #{img} #{tag}"
|
||||||
run "docker tag #{img} #{latest}"
|
run "docker tag -f #{img} #{latest}"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
GOOD=true
|
||||||
|
|
||||||
|
if [ -z "$ORIGIN_URL" ]; then
|
||||||
|
unset GOOD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PROXY_URL" ]; then
|
||||||
|
unset GOOD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SSO_SECRET" ]; then
|
||||||
|
unset GOOD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SSO_URL" ]; then
|
||||||
|
unset GOOD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$GOOD" ]; then
|
||||||
|
echo "#!/bin/sh"
|
||||||
|
echo
|
||||||
|
echo "# you are going to need to set the following env vars and run"
|
||||||
|
echo "# the image like this"
|
||||||
|
echo
|
||||||
|
echo "ORIGIN_URL=http://somesite.com"
|
||||||
|
echo "SSO_SECRET=somesecret"
|
||||||
|
echo "SSO_URL=http://someurl"
|
||||||
|
echo "HOST_PORT=3001"
|
||||||
|
echo
|
||||||
|
echo "docker run -d --restart:always -e ORIGIN_URL=\$ORIGIN_URL -e PROXY_URL=http://0.0.0.0:80 -e SSO_SECRET=\$SSO_SECRET -e SSO_URL=\$SSO_URL -p \$HOST_PORT:80 samsaffron/discourse-auth-proxy"
|
||||||
|
else
|
||||||
|
exec /bin/discourse-auth-proxy
|
||||||
|
fi
|
Loading…
Reference in New Issue