bash is easy when you know bash
authorMichael Brown <michael.brown@discourse.org>
Tue, 26 Aug 2014 05:53:34 +0000 (01:53 -0400)
committerMichael Brown <michael.brown@discourse.org>
Tue, 26 Aug 2014 05:53:34 +0000 (01:53 -0400)
also, lining up columns is super important

launcher
templates/web.template.yml

index 8f7268272d84f00ac84116f9bab9dab268c39a80..bc358fc8a7abc1f275a8263ad36b52ff01b7f2cd 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -245,7 +245,7 @@ if compare_version "1.2.0" "$docker_version"; then
   echo "We recommend you upgrade docker, the version you are running has no restart policies, on reboot your container may not start up"
   restart_policy=""
 else
-  restart_policy="--restart=always "
+  restart_policy="--restart=always"
 fi
 
 
@@ -286,12 +286,7 @@ run_start(){
          exit 1
        fi
 
-       run="run"
-       if [ -n "${restart_policy}" ]; then
-          run="$run $restart_policy"
-       fi
-
-       $docker_path $run "${env[@]}" -h "`hostname`-$config" -e DOCKER_HOST_IP=$docker_ip --name $config -t --cidfile $cidfile $ports \
+       $docker_path run $restart_policy "${env[@]}" -h "`hostname`-$config" -e DOCKER_HOST_IP=$docker_ip --name $config -t --cidfile $cidfile $ports \
                   -d $volumes $local_discourse/$config /sbin/runit
 
        exit 0
index d82fd18a3780f3a37485468e11ffeb050146f61c..eeae3bc37bfe159182c44128ba87fb52922d05bf 100644 (file)
@@ -68,7 +68,7 @@ run:
         - mkdir -p tmp/sockets
         - touch tmp/.gitkeep
         - mkdir -p                    /shared/log/rails
-        - bash -c "touch -a            /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log"
+        - bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log"
         - bash -c "ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log $home/log"
         - bash -c "mkdir -p           /shared/{uploads,backups}"
         - bash -c "ln    -s           /shared/{uploads,backups} $home/public"