push through all DISCOURSE env vars so you can exec rake tasks
authorSam Saffron <sam.saffron@gmail.com>
Thu, 2 Jan 2014 22:22:54 +0000 (14:22 -0800)
committerSam Saffron <sam.saffron@gmail.com>
Thu, 2 Jan 2014 22:22:54 +0000 (14:22 -0800)
templates/sshd.template.yml

index 7325262b439e56e6fadfe1bcec7b5896d6372250..0e662f6079d0786202aae53fd97b385956b478cd 100644 (file)
@@ -13,9 +13,13 @@ run:
      path: /etc/service/sshd/run
      chmod: "+x"
      contents: |
-        #!/bin/sh
+        #!/bin/bash
         exec 2>&1
         echo export DOCKER_HOST_IP=$DOCKER_HOST_IP > /etc/profile.d/docker.sh
+        for x in `env | /usr/bin/awk -F= '{if($1 ~ /DISCOURSE_/) print $1}'`
+          do
+             echo export "$x"=${!x} >> /etc/profile.d/docker.sh
+          done
         chmod +x /etc/profile.d/docker.sh
         exec /usr/sbin/sshd -D -e